Skip to content

Handle OpenAPI 3.1 array type specifier in SerDes#1201

Open
Pijukatel wants to merge 2 commits into
cdimascio:masterfrom
Pijukatel:nullable_syntax_3_1
Open

Handle OpenAPI 3.1 array type specifier in SerDes#1201
Pijukatel wants to merge 2 commits into
cdimascio:masterfrom
Pijukatel:nullable_syntax_3_1

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Jun 17, 2026

Copy link
Copy Markdown

Handle OpenAPI 3.1 array type specifier in SerDes.
Add test.

Example type specifiers: [string, 'null'], [array, 'null']

Example schema:

paths:
  /nullable_dates:
    get:
      responses:
        200:
          description: 'Get nullable array of nullable dates'
          content:
            application/json:
              schema:
                # 3.1 syntax nullable array
                type: [array, 'null']
                items:
                  type: object
                  properties:
                    createdAt:
                      # 3.1 syntax nullable item
                      type: [string, 'null']
                      format: date-time

Running validator on response according to this schema would previously throw this warning:
/response/1/createdAt must be string,null

Related issue: #1177

@Pijukatel Pijukatel marked this pull request as ready for review June 17, 2026 06:48
@Pijukatel

Copy link
Copy Markdown
Author

Hello @cdimascio, we are using the validator in our project, and we see a lot of false positives related to the OpenAPI 3.1 array type syntax.

I am not familiar with the validator implementation, so this is my naive attempt to fix it. Please let me know if you think it is going in the right direction. Thanks.

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

Successfully merging this pull request may close these issues.

1 participant