-
Notifications
You must be signed in to change notification settings - Fork 0
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
swagger & api & swagger ui #5
Labels
bug
enhancement
Error: Response validation failed
Error: Response validation failed: failed schema validation
help wanted
question
swagger & api & swagger ui
swagger & api & swagger ui
swagger api
swagger api
swagger node
swagger node
yaml & bug
yaml & bug
Comments
Repository owner
locked and limited conversation to collaborators
Oct 18, 2018
error
Error initializing middleware
Error: Swagger document(s) failed validation so the server cannot start
|
solution
$ cd ./api/swagger && swagger validate swagger.yaml
https://stackoverflow.com/questions/37435400/not-a-valid-parameter-definition-swagger-json http://23.22.16.221/v2/schema.json# https://npmdoc.github.io/node-npmdoc-swagger-tools/build/apidoc.html |
xgqfrms
added
bug
enhancement
help wanted
question
swagger node
swagger node
swagger api
swagger api
yaml & bug
yaml & bug
labels
Oct 18, 2018
Errorhttp://localhost:8080/users?user=xgqfrms {
"message": "Cannot read property 'value' of undefined"
}
http://localhost:8080/users?name=xgqfrms {
"message": "Cannot read property 'value' of undefined"
}
OKhttp://127.0.0.1:8080/hello?name=xgqfrms {
"message": "Hello, xgqfrms!"
}
|
Error: Response validation failed: failed schema validation |
bug ??? |
solution
validateResponse: false
# swagger configuration file
# values in the swagger hash are system configuration for swagger-node
swagger:
fittingsDirs: [ api/fittings ]
defaultPipe: null
swaggerControllerPipe: swagger_controllers # defines the standard processing pipe for controllers
# values defined in the bagpipes key are the bagpipes pipes and fittings definitions
# (see https://github.com/apigee-127/bagpipes)
bagpipes:
_router:
name: swagger_router
mockMode: false
mockControllersDirs: [api/mocks]
controllersDirs: [api/controllers]
_swagger_validate:
name: swagger_validator
validateResponse: false
# validateResponse: true
# pipe for all swagger-node controllers
swagger_controllers:
- onError: json_error_handler
- cors
- swagger_security
- _swagger_validate
- express_compatibility
- _router
# pipe to serve swagger (endpoint is in swagger.yaml)
swagger_raw:
name: swagger_raw
# any other values in this file are just loaded into the config for application access...
|
xgqfrms
added
the
Error: Response validation failed
Error: Response validation failed: failed schema validation
label
Oct 18, 2018
// http://localhost:8080/users?user=xgqfrms
{
"users": "Hello, xgqfrms!"
}
// http://localhost:8080/users?name=xgqfrms
{
"users": "Hello, stranger!"
} |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bug
enhancement
Error: Response validation failed
Error: Response validation failed: failed schema validation
help wanted
question
swagger & api & swagger ui
swagger & api & swagger ui
swagger api
swagger api
swagger node
swagger node
yaml & bug
yaml & bug
swagger & api & swagger ui
https://www.cnblogs.com/xgqfrms/p/9808520.html
The text was updated successfully, but these errors were encountered: