-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render JsonSchema constraints #42
Comments
Defaults are supported for primitive types only. Need to add this to the known issues |
@RomanGotsiy Should |
@MikeRalphson yes, you're right. Updated. |
I know this is marked as post v1.0, but I'd like to mention that we use "pattern" a lot in our API definitions - almost every field is solely determined by pattern - because it is a very simple way to document what kind of values are accepted. Showing that somehow in the rendered documentation would be important for us. |
@nakedible-p, |
@nakedible-p finally get to this. Maybe you have better idea? |
I think it is perfect. Slashes are the universal regexp indicator. |
Great, hopefully will publish new minor release with this today. Max - tomorrow. |
@nakedible-p New version is released. |
Hello, any hope for |
@fgabolde do you have any ideas of how this may look in ReDoc? Similar to |
Yeah, probably. Right now a size constraint on a string is represented like this:
Just replacing "characters" with "items" sounds good to me. |
I don't see the # definition
HTTPSURL:
type: string
format: uri
pattern: "^https?" # this one displays "/^https?/" as expected
Thing:
type: object
properties:
single:
$ref: '#/HTTPSURL' # this one does not
ManyThings:
type: object
properties:
multiple:
type: array
items:
$ref: '#/HTTPSURL' I do see the This is Redoc 1.21.2. |
…#700) According to #42 , `minItems` and `maxItems` are not yet rendered in the documentation. This pull request shows the humazined form of `minItems` and `maxItems` next to the type description. The [suggestion of fgabolde](#42 (comment)) is followed and "characters" is simply replaced with "items". ![image](https://user-images.githubusercontent.com/1814807/47999845-0a13f900-e104-11e8-9ddc-adab701ec0bb.png) Some examples are added to the demo.
@RomanGotsiy Thank you for the fantastic documentation tool! However, I'm confused about For a POST-to-create I can understand stripping out For GET and PUT, the HTTP semantics are that the GET response and PUT request are both representations of the target resource, so you should be able to do a GET, modify some fields, and PUT it right back. As long as you don't change the Similarly, if I want to make a copy of a resource, I'll do a GET of it, tweak it, and then POST the tweaked version back to the collection. In order to make this behavior clear, the |
@handrews yeah, you're right. That's an incorrect assumption 🙈 I think we can add configuration options to disable stripping out and mark fields as readOnly/readWrite instead. I will try to do in once I find some time. But your PR would be much appreciated! |
@RomanGotsiy I'll see if I can put something together in the next week-ish. I took a look and it looks reasonably straightforward- nice job piping the settings through. Looks like the request body behavior is set in |
@fgabolde I also have the problem that I can't see the |
All constraints were added and the issue is too old. I close that. If someone wants to report supporting additional JsonSchema constraints, feel free to open a new issue. |
readOnly
- don't show readOnly fields in request schemareadOnly
in responseto be continued...
The text was updated successfully, but these errors were encountered: