Skip to content

OpenAPI 3.1 nullable compatibility #616

@lusimeon

Description

@lusimeon

Description
OpenAPI 3.1 specification defines Schemas properties nullable types as described below to follow JSON Schema 4.

API Platform Admin openAPI schema Analyzer does not process nullable type and fallback to string type instead of extracting type from the non-nullable type. This introduces wrong input type when using Component like InputGuesser for example.

Schema Analyzer should take into account nullable types.

Example

# OpenAPI specification example
[…]
properties:
    myProperty:
        type:
            - integer
            - null

# Before fix
schemaAnalyze field type is `string`

# After fix
schemaAnalyzer field type is `integer`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions