Closed MartinDelVecchio closed 6 years ago
There is not, our semantic validation is contained within the Swagger-Editor project.
That being said, thank you for mentioning it! We'll take it into consideration as we continue to improve the project.
Closing for now - if there's anything else, or I misunderstood something, just reply!
PS: there is a library that works as a CLI for extended validation, check out https://github.com/wework/speccy. It's not related to the validators in Swagger-Editor, though.
I have tried several other validators, and they all give thumbs-up to documents that the online Swagger Editor finds fault with.
So for now, I am stuck manually uploading my Swagger to the online editor, and verifying that it still passes. And doing that before my boss does.
Thanks.
@MartinDelVecchio do you get the same experience of 'valid' documents using our online validator?
I'm not sure I understand the question.
Is "our online validator" a different tool than the online Swagger editor (https://editor.swagger.io/)?
Thanks.
Yes, it's a different tool - it's the one used to validate through swagger-ui. For example, https://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagger.json.
I'm using:
docker run --rm -v $PWD:$PWD -w $PWD -it swaggerapi/swagger-codegen-cli validate -i openapi.yaml
Altought its output isn't as good as the one the online editor gives. If I can't decode what that validator says then I copy&paste to online editor, and after I'm finished I also copy it to the editor for final inspection and documentation preview.
I'd also welcome if you could extract the validations used in swagger-editor into a separate lib. I have the same issue as @MartinDelVecchio - the java-validation says everything's fine but editor.swagger.io finds lots of issues with my generated spec. I'm no javascript expert - would it be a lot of work to create a separate js module?
@FloWi: would it be a lot of work to create a separate js module?
It wouldn't be a nightmare, but the validation system is currently mounted to the Swagger UI plugin system in a few places, so structural changes would need to be made.
@shockey: It wouldn't be a nightmare, but the validation system is currently mounted to the Swagger UI plugin system in a few places, so structural changes would need to be made.
That sounds great. Looking forward to it. Maybe I can convince some of our javascript guys to chip in :)
@MartinDelVecchio do you get the same experience of 'valid' documents using our online validator?
Currently I'm getting different results using: editor.swagger.io and online.swagger.io, the first one finds errors while the second one reports everything is good.
I'm looking for a way to automate this on my CI/CD, but using online.swagger.io is not finding the issues that I need to avoid.
I appreciate any direction!
hey @mambru, IMO the way you're currently doing it is the best way 😕 Swagger Editor's validation engine is still only available in the Editor itself.
hey @mambru, IMO the way you're currently doing it is the best way 😕 Swagger Editor's validation engine is still only available in the Editor itself.
@shockey @FloWi Is there any future plan to take out the swagger editor's validation engine and provide it as an independent module ?
@shockey I vote +1 for this request. This would be useful for developing automation.
+1 on this. We are also facing the same issue, that other validators doesn't work well.
this would be very helpful
please
do you get the same experience of 'valid' documents using our online validator
@webron Two examples I've seen recently of errors flagged by swagger-editor but missed by the online validator:
#/definitions/object
, in case that's special somehow).enum
and default
properties, where the latter is not among the members of the former.This was when validating v2 models. Not sure if v3 would do the same.
I haven't found anything as reliable as swagger-editor's internal validator. I would love to see the latter available separately from the online editor.
I am using https://editor.swagger.io to validate my Swagger. I am getting errors like this:
Semantic error at paths./whatever/whatever Read only properties cannot be marked as required by a schema.
Semantic error at definitions.whatever.properties.something.description Sibling values are not allowed alongside $refs
I want to perform this level of validation during my build process. Is there a command-line tool that performs this same level of validation?
Demonstration API definition
Configuration (browser query string, constructor, config.yaml)
Expected Behavior
Current Behavior
Possible Solution
Context