Skip to content
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

Conformance with OAS 3.0.* #161

Open
AnyCPU opened this issue Nov 16, 2024 · 1 comment
Open

Conformance with OAS 3.0.* #161

AnyCPU opened this issue Nov 16, 2024 · 1 comment

Comments

@AnyCPU
Copy link

AnyCPU commented Nov 16, 2024

I have trouble using Stripe OAS with OAS code generators, specifically in Go.

Let's take a look at an example of Stripe OAS below:

openapi: 3.0.0
paths:
  /v1/account:
    get:
      description: <p>Retrieves the details of an account.</p>
      operationId: GetAccount
      parameters:
        - description: Specifies which fields in the response should be expanded.
          explode: true
          in: query
          name: expand
          required: false
          schema:
            items:
              maxLength: 5000
              type: string
            type: array
          style: deepObject

It belongs to a stripe specific feature like expandable objects - https://docs.stripe.com/api/expanding_objects.

But the deepObject style cannot represent arrays according to following info - https://swagger.io/specification/v3/#parameter-object.

There you can find some examples how styles are applied.
A form style could have been used.

It was mentioned earlier there - #153.

And I understand that it is not a bug it is a feature, because you use a custom private code generator.

Also I guess that it is not possible to patch it simply like style: deepObject -> style: form, because, for instance, a stripe server will not accept it.

So that's why I think it would be nice to:

  • update documentation, add more explicit statement about a conformance with OAS 3.0.*;
  • add an OAS extension in case of expandable object.

For instance:

openapi: 3.0.0
paths:
  /v1/account:
    get:
      description: <p>Retrieves the details of an account.</p>
      operationId: GetAccount
      parameters:
        - description: Specifies which fields in the response should be expanded.
          explode: true
          in: query
          name: expand
          required: false
          schema:
            items:
              maxLength: 5000
              type: string
            type: array
          style: deepObject
          x-vendor-style: stripe

It might allow to handle it more correctly in 3rd party code generators.

@jar-stripe
Copy link
Contributor

jar-stripe commented Nov 19, 2024

@AnyCPU thanks for the suggestion here! We'll add it to our backlog for future discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants