-
Notifications
You must be signed in to change notification settings - Fork 141
Description
Per the recent merge in openapi_parser to solve ota42y/openapi_parser#29 - it is now possible for the OAS3 schema parser to validate the schema's references on load.
In the future, we want this to be the default option on openapi_parser, which means there will be a behavior change in Committee as well (and I'm not sure if there is even a use case to allow broken references -- would love to hear input on this topic).
If we want to "upgrade" Committee users, we need to pass a parameter:
committee/lib/committee/drivers.rb
Line 54 in 4d4f202
| openapi = OpenAPIParser.parse_with_filepath(hash, schema_path) |
openapi = OpenAPIParser.parse_with_filepath(hash, schema_path)
becomes
openapi = OpenAPIParser.parse_with_filepath(hash, schema_path, { strict_reference_validation: true })
We are not changing the interface of OpenAPI Parser, and prior to openapi_parser 1.0.0.beta1, this configuration did not exist -- so passing the config is a "NOOP" if the Committee user isn't using the latest beta -- so we don't have to worry about backward compatibility with the openapi_parser Gem versions.
Doing what I suggest above will break some Committee users who have unknown (or known) invalid references in their OAS3 files. So I think it may be better to offer this strict validation as a configuration on Committee as well (eventually defaulting to "strict", or at least leaving it to the user to decide).
OR, another thought would be to leave the openapi_parser Gem version specified by Committee at an older version -- and make the code change above (relying on the fact it will be ignored by older parsers) -- and then when we decide to make this mandatory on Committee, just bump the openapi_parser referenced Gem version.
Before I attempt a draft implementation on Committee, I'd like to collect feedback from the maintainers.