-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Question: use of a JSON schema in the models #1480
Comments
The Address:
{
"type": "object",
"properties": {
...
},
"required": [...],
"example": { // <-----------
"street1": "126 Main Street",
"street2": "Apt 1A",
"city": "Atlanta",
"state": "GA",
"zipcode": "30342",
"label": "home"
}
} |
@CameronGo Does that work for you? |
Sorry for the long delay. Finally got back to my OAS3 conversion and yes, as noted above that is what I was missing. I didn't; however, need to add the comment tag, I just needed to move my example inside the json object for my schema. Thanks so much for showing me what I was doing wrong! |
Hi, I'm working on porting over my RAML to OpenAPI spec. I am doing the documentation of the API in a yaml file, but I prefer to document the schemas and the examples in JSON (since the is how all of my responses are returned. This seems to let me do this, but when I have both the schema and the example in JSON, I get rendering errors. I've tried manipulating the spacing in various combinations and cannot get it working.
Is this not allowed? Do I need to change my approach somehow, or is there something simple I can change to get it to work this way?
Here is an excerpt form my #/components/schemas/Address that works:
But then when I try to use my JSON schema I get these errors:
Schema error at components.schemas['example']
should NOT have additional properties
additionalProperty: street1, street2, city, state, zipcode, label
Jump to line 4800
Parser error bad indentation of a mapping entry
Jump to line 4801
Here is the same excerpt with the RAML for the schema definition replaced by a true JSON schema:
The text was updated successfully, but these errors were encountered: