Skip to content

Null property type with quotes not generated #553

Open
@TopIvanAbramov

Description

@TopIvanAbramov

Description

If in YAML I specify null type with quotes generator omits the property. But if I specify null as a type without quotes everything works well

Reproduction

CustomerUpdate:
      properties:
        given_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Given Name

But this works fine:

CustomerUpdate:
      properties:
        given_name:
          anyOf:
            - type: string
            - type: null
          title: Given Name

The same issue with json, generator works only if null type isn't surrounded by quotes

Package version(s)

swift-open-api-genrator 1.2.1
swift-openapi-runtime 1.3.2
swift-openapi-urlsession 1.0.1
Yams 5.1.0
OpenAPIKit 3.1.3

Expected behavior

Generator should parse 'null' - with quotes too

Environment

swift version: 5.9

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugFeature doesn't work as expected.status/triageCollecting information required to triage the issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions