Comments (5)
I've traced it down into swaggerSpec.js in the createParamGroupSchemas() method. This method assumes each parameter's schema has the 'properties' property whereas the schema for an array parameter doesn't.
I'm wondering if I were possible to flatten out the array definitions to remove the $ref's if the jsonschema validate method would work.
Thoughts?
from swagger-routes.
Thanks for the details. I'm on a short break right now but will take a look next week when I'm back.
from swagger-routes.
from swagger-routes.
I found a way around this issue, and I'm fairly certain it has nothing to do with swagger-routes but the jsonschema module.
If I change the definition of the parameter in the add method from:
"parameters": [
{
"name": "organization",
"in": "body",
"description": "organization(s) to add to the system",
"required": true,
"schema": {
"$ref": "#/definitions/NewOrganizations"
}
}
]
to
"parameters": [
{
"name": "organization",
"in": "body",
"description": "organization(s) to add to the system",
"required": true,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/NewOrganization"
}
}
}
],
everything works as expected. Essentially the difference in the two definitions is the second one is a bit more explicit but otherwise seems equivalent to me.
Anyway, sorry for the noise.
from swagger-routes.
Good to hear, thanks for posting the solution 👍
from swagger-routes.
Related Issues (15)
- Removing an API, adding an API using JSON and preventing handler generation. HOT 4
- Support for OpenAPI 3.0 HOT 6
- Response validation
- Unexpected fields validation HOT 1
- Errors from middleware swallowed by promise HOT 2
- Help on usage HOT 3
- Not initializing on Windows
- Support for restify 7.x and 8.x HOT 2
- Order of excecution of security handlers
- formData required validation HOT 2
- `apiSpecs.js` broken after axios update
- Split apiSpecs into separate module
- path.id is not of a type(s) integer HOT 1
- Array items failing validation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swagger-routes.