You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experimenting with compojure-api for documenting a new set of APIs with Prismatic Schema. It;s working well so far, though I have one issue which is not obvious how to resolve - how to generate realistic example values for an input / output schema.
Currently I get Example Values in the swagger UI like this:
In this case, I need ownerID to be a 64 character hex string which satisfies a custom valid-user-id? predicate, which defined in Schema as something like:
(s/defschema UserID
(s/constrained s/Str valid-user-id? "Valid User ID"))
However it's not clear how to get compojure-api to generate valid values which satisfy the constraint (The value "string" doesn't....) and display these to the user in the Swagger UI.
Is there a way to do this? Ideally I would like to be able to specify a custom generator for the schema, which I build easily enough with test.check but how do I get that to be reflected in the Swagger UI?
Any help much appreciated!
The text was updated successfully, but these errors were encountered:
Library Version(s)
1.1.11
Problem
I'm experimenting with compojure-api for documenting a new set of APIs with Prismatic Schema. It;s working well so far, though I have one issue which is not obvious how to resolve - how to generate realistic example values for an input / output schema.
Currently I get Example Values in the swagger UI like this:
In this case, I need ownerID to be a 64 character hex string which satisfies a custom
valid-user-id?
predicate, which defined in Schema as something like:However it's not clear how to get compojure-api to generate valid values which satisfy the constraint (The value "string" doesn't....) and display these to the user in the Swagger UI.
Is there a way to do this? Ideally I would like to be able to specify a custom generator for the schema, which I build easily enough with
test.check
but how do I get that to be reflected in the Swagger UI?Any help much appreciated!
The text was updated successfully, but these errors were encountered: