Skip to content

V2 - Why is OpenAPISchema.Type of type "object"? #1874

@baywet

Description

@baywet

This provides a really poor development experience, forcing the consumer to implement complex type assertions when it shouldn't be required.

And then we do things like those:

Which is not only going to be slow, but also problematic for people using AOT/trimming.

We already know that OAS 3.1 and Json Schema only support the following types:

  • null
  • boolean
  • object
  • array
  • number
  • string

(maybe we could add compatibility with the integer mess).

Why not instead:

  • Define an enum for those types
  • Make the type property, an array/list/enumerable of that enum
  • When serializing as v2/v3, ensuring that we emit the right compatible information.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions