Skip to content

Commit

Permalink
Merge pull request #1138 from maykinmedia/feature/1128-additional-typ…
Browse files Browse the repository at this point in the history
…e-constants

Provide all fixed field names for the components object in ResolvedComponent.* constants
  • Loading branch information
tfranzel authored Jan 3, 2024
2 parents 200b123 + 22a7139 commit c53b677
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drf_spectacular/plumbing.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,18 @@ def alpha_operation_sorter(endpoint):


class ResolvedComponent:
# OpenAPI 3.0.3
SCHEMA = 'schemas'
RESPONSE = 'responses'
PARAMETER = 'parameters'
EXAMPLE = 'examples'
REQUEST_BODY = 'requestBodies'
HEADER = 'headers'
SECURITY_SCHEMA = 'securitySchemes'
LINK = 'links'
CALLBACK = 'callbacks'
# OpenAPI 3.1.0+
PATH_ITEM = 'pathItems'

def __init__(self, name, type, schema=None, object=None):
self.name = name
Expand Down

0 comments on commit c53b677

Please sign in to comment.