Skip to content
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

Added exampleSetFlag to nonValidationKeyword #435

Merged
merged 1 commit into from
Aug 18, 2021

Conversation

ShubhamRwt
Copy link
Contributor

Issue:

When using vertx, there is a keyword exampleSetFlag present in swagger which is transitive dependency of vertx . So when we run the verticle we get a warning like this :-
<onMetaSchema:338> [oop-thread-1] Unknown keyword exampleSetFlag - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword

PR purpose :-

It adds the variable exampleSetFlag to the nonValidationKeyword in V4 since the OpenApiv3 use the Json schema v4 --> private static final JsonMetaSchema META_SCHEMA = JsonMetaSchema.builder(JsonMetaSchema.getV4().getUri(), JsonMetaSchema.getV4()).addKeyword(new NonValidationKeyword("example")).build();

@stevehu
Copy link
Contributor

stevehu commented Aug 18, 2021

This is a temp solution to compensating a bug from the swagger. And it might be removed in the future as the exampleSetFlag is not a JSON Schema keyword.

I did a search and seems this issue has been resolve by the swagger team already. swagger-api/swagger-core#3702
Also, it is only a warning message in the log, it this a big concern for your team? I am OK to accept a PR as a temporary workaround for the Swagger bug and you should change the version you are using not the v4 I mentioned in the example above.

@stevehu stevehu merged commit 2a1fac7 into networknt:master Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants