-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
oas3-valid-oas-content-example
rule needs to obey readOnly/writeOnly property
#1274
Comments
I encountered this issue today and found this. |
We also encountered this bug today.
(However in our case it was the |
I encountered this bug yesterday, using Stoplight, prepared a test document and came here to create an issue and found this one.
And here is Spectral output:
|
I'm having the exact same problem. Is there any solution to this? |
Ping @P0lip to find out where the piece of code that needs to be updated is. Could you give some guidance about how to implement a fix and its test? Or it is easier to write a custom ruleset? |
Hey team! Please add your planning poker estimate with ZenHub @Amjcraft @jasonmgillhub @dotslashderek @kaylachun @cjlanzo |
@Kwadz My apologies, I haven't seen the ping. (Feel free to ping me again next time :)) Here's where the code lives https://github.com/stoplightio/spectral/blob/develop/packages/rulesets/src/oas/functions/oasExample.ts, and the test for the faulty rule is over here https://github.com/stoplightio/spectral/blob/develop/packages/rulesets/src/oas/__tests__/oas3-valid-media-example.test.ts. |
Still not fixed 2 years later? This can't possibly be that hard to resolve can it? Ran into this on stoplight.io today. |
Just tested with Spectral 6.4.2, the issue still exists but the impacted rule has changed, namely oas3-valid-media-example and not oas3-valid-oas-content-example anymore.
|
I can confirm that the issue is still there, it would be nice to fix this as it's creating problems with some of our OAS files. |
Same, confirming the issue is still there in version 6.8.0 |
Still there in 6.10.0 as well. |
Has anyone found a workaround? I don't like totally disabling this rule, but I'm not seeing many other choices without adding a ton of unnecessary definitions |
🎉 This issue has been resolved in version 1.19.0 🎉 The release is available on Your semantic-release bot 📦🚀 |
Describe the bug
According to https://swagger.io/docs/specification/data-models/data-types/ :
The rule
oas3-valid-oas-content-example
should not raise error when areadOnly
andrequired
property is missing in request example. And alsowriteOnly
property isn't required in response example.The rule
oas3-valid-media-example
has the same bug as well.To Reproduce
spectral lint index.yaml
Expected behavior
This error report is not expected.
The
self
property is readOnly, it isn't required in request.Environment (remove any that are not applicable):
The text was updated successfully, but these errors were encountered: