oooas
oooas copied to clipboard
Unable to set required property scopes as empty Map
According to https://swagger.io/specification/#oauth-flow-object, the attribute "scopes" is required (when type=oauth2) and may be an empty map (in yaml: {}
).
However, there seems to be no way to set an empty map through https://github.com/goldspecdigital/oooas/blob/master/src/Objects/OAuthFlow.php#L106
You can pass an empty array, but that will translate to []
instead of {}
in JSON.
Without this property, official schema validation fails. When passing an empty array, $openApi->validate()
fails.
If we set scopes to (object)[]
if it's null then that should do the trick. Keeping this issue open until I get a PR ready.
https://github.com/goldspecdigital/oooas/blob/b5c48ce12eb15261e7eeaff6b477cbff36b56cbf/src/Objects/OAuthFlow.php#L127-L136