Closed cspags closed 1 month ago
Hi @cspags, thanks for reporting this.
I spent some time looking into what's causing this, and the spec has an interesting pattern in it:
- properties:
code:
type: string
description: Error code
enum:
- missing_scopes
type: string
As a human reading this, I interpret it to mean that the parent object has a property code
and can have additional properties with any name and string
values. Normally in this situation I would see something like this:
- properties:
code:
type: string
description: Error code
enum:
- missing_scopes
additionalProperties:
type: string
This is done elsewhere in the spec, so it's interesting that they don't do it here. It's also possible that they want to specify a property called type
with string values, which would normally look like this:
- properties:
code:
type: string
description: Error code
enum:
- missing_scopes
type:
type: string
I'm not sure if you have a way to ask questions of the spec authors, but it may be worth reaching out if so. While it's definitely possible for me to modify the reader to look for type: _
as a property and treat it as a generic additional property, this could have the potential side affect of not allowing specs with a property called type
.
Of course, it's always possible I've misinterpreted part of the OpenAPI spec. If so, let me know!
Thanks @aj-foster for taking the time to look into this, I appreciate it. I agree it looks like an issue with the spec. I will reach out to them and see what I can learn. Feel free to close this issue as I think you're right that it's not worth accounting for this due to the potential for side effects.
Thank you!
Hope you get some resolution. As you learn more about their intent, I'd love to hear about it! ❤️
Hi there, super interested in trying this out, but I'm getting an error for the spec I'm using it with. Any help would be much appreciated, thank you!
Spec: https://github.com/webflow/openapi-spec/blob/main/openapi/v2.yml
Error:
Repo to reproduce: https://github.com/cspags/ex_webflow_api_client