Skip to content

OpenAPI 3.0 should generate and reference #/components/schemas/ #6984

Closed
@partimer

Description

@partimer

Checklist

  • [X ] I have verified that that issue exists against the master branch of Django REST framework.
  • [X ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • [X ] This is not a usage question. (Those should be directed to the discussion group instead.)
  • [X ] This cannot be dealt with as a third party library. (We prefer new functionality to be in the form of third party libraries where possible.)
  • [ X] I have reduced the issue to the simplest possible case.
  • I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)

Steps to reproduce

Swagger 2.0 supports the concept of a definition #/definitions/{ModelName}. This is superseded in OpenAPI 3.0 with #/components/schemas/{ModelName}

Expected behavior

  1. OpenAPI 3.0 output should contain #/components/schemas/{ModelName}
  2. Each schemas should minimally contain the same type of information found in Swagger 2.0 definitions.
  3. Optionally, #/paths/... can reference #/components/schemas/{ModelName} rather than a full definition
  4. #/components/schemas/{ModelName} should include "title" and format="uri"

Actual behavior

  1. #/components/schemas is not generated.
  2. Information has to be scoured from the #/paths/...
  3. Some Information found in Swagger 2.0 definitions such as string format information is not present in any equivalent form.
  4. Information in i.e. #/paths.../properties/schemas is often duplicated (bigger schema file)

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