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

Unexpected additional properties analysis #206

Open
IvanStawski opened this issue Nov 13, 2020 · 5 comments
Open

Unexpected additional properties analysis #206

IvanStawski opened this issue Nov 13, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@IvanStawski
Copy link

To Simplify test analisys with

  • Issue: now validator dosn't give us possibility to understand what new properties appeared in the response, which not described in the schema
  • Proposal: After some time I can create a PR with workaround which we using on the project to get unexpected properties list. Example of the error message: https://prnt.sc/viqtti

Does it make sense?

@rwalle61
Copy link
Collaborator

rwalle61 commented Nov 13, 2020

Thanks @IvanStawski, what validation error does our plugin currently give when the response object contains additional properties to those described in the OpenAPI response schema?

Have you definitely specified additionalProperties: false in your OpenAPI spec?

additionalProperties - Value can be boolean or object. Inline or referenced schema MUST be of a Schema Object and not a standard JSON Schema. Consistent with JSON Schema, additionalProperties defaults to true.

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#schema-object

@IvanStawski
Copy link
Author

Thanks @IvanStawski, what validation error does our plugin currently give when the response object contains additional properties to those described in the OpenAPI response schema?

  1. Example of the current validation error given in the current version: https://prnt.sc/vuz8cw. There is no any mention of what field was actually appeared in the response

Have you definitely specified additionalProperties: false in your OpenAPI spec?

  1. Yes, exactly. this is the case. When such unclear validation error appears

@rwalle61 rwalle61 added the enhancement New feature or request label Dec 14, 2020
@rwalle61
Copy link
Collaborator

Ah thanks @IvanStawski, sorry, I understand now that you'd like the assertion message from a definition using additionalProperties: false to be clearer.

If you'd like to help resolve this, please recreate an example using the bugRecreationTemplate. (I assume you'd like throw to throw an error like https://prnt.sc/viqtti)

@IvanStawski
Copy link
Author

please recreate an example using the bugRecreationTemplate

Please clarify: How should I provide an example? Should I make a PR or something else?

@rwalle61
Copy link
Collaborator

rwalle61 commented Dec 19, 2020

Yea please fork this repo and make a branch recreating this scenario in the bugRecreation template (i.e. write a test where we fail to output the assertion error you'd like). Link it here, then someone (or yourself if you want) can make the test pass. I'm happy to guide them on how to implement the change to our code.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants