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

oneOf support in openapi2kong parameter schemas #206

Open
1 task
mheap opened this issue Sep 24, 2024 · 4 comments
Open
1 task

oneOf support in openapi2kong parameter schemas #206

mheap opened this issue Sep 24, 2024 · 4 comments
Assignees

Comments

@mheap
Copy link
Member

mheap commented Sep 24, 2024

The request validator plugin configuration generated by openapi2kong is invalid when using oneOf

/test/data-type:
  get:
    parameters:
      - in: query
        name: mixed_number
        required: true
        schema:
          oneOf:
            - type: string
            - type: integer

Kong Gateway does not support mixed content types in a single parameter (FTI-2182), so go-apiops should return an error instead of generating an invalid configuration.

Acceptance Criteria

  • Parameter queries that use oneOf to specify multiple type fields in a single parameter result in an error being returned
@Tieske
Copy link
Member

Tieske commented Sep 24, 2024

This logic (checking for oneOf) will not suffice, it should match the logic of the request validator plugin to prevent edge cases.

@mheap
Copy link
Member Author

mheap commented Sep 24, 2024 via email

@Tieske
Copy link
Member

Tieske commented Sep 25, 2024

see docs: https://docs.konghq.com/hub/kong-inc/request-validator/configuration/#config-parameter_schema-schema

The top-level jsonschema object MUST have a type property. An edgecase to be aware of is that the top-level can actually be a $ref, in that case, follow the refs and ensure that the first non-ref has a type property. See internal ticket FTI-5958

@Tieske Tieske changed the title oneOf support in openapi2kong oneOf support in openapi2kong parameter schemas Sep 25, 2024
@Tieske
Copy link
Member

Tieske commented Sep 25, 2024

Also; only applies to parameter schemas.

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

No branches or pull requests

3 participants