OpenAPIKit
OpenAPIKit copied to clipboard
Add decoding options that allow relaxing certain errors
There are some kinds of errors that might be beneficial to simply warn over or even work around under some circumstances instead of completely failing to decode. It would be good to offer options around this.
A couple of ideas:
- Empty string URLs (a la the Jira OpenAPI documentation currently commented out in the compatibility suite).
- Multiple status codes per key (a la the warning/workaround currently in place to make it possible to parse the TomTom OpenAPI currently in the compatibility suite).
This might be workable by just defaulting to a more lenient decoding operation and adding the same guarantees back via the validation system so that decoding will succeed but validation will fail (barring a custom validation setup, which is a built-in possibility with OpenAPIKit).
Per the previous comment, this has started to be implemented by producing warnings during decoding that can then be turned into errors by validating the document (which defaults to a strict mode but can also be told to not elevate warnings to errors).
At some point I deleted the Jira OpenAPI compatibility suite test and I have since implemented the suggested warning for multiple status codes so I will close this issue in favor of more targeted suggestions for specific warnings in the future.