Skip to content

[OpenAPI Docs] OpenAPI 3 AllOf is not working #81

@Radiquum

Description

@Radiquum

I'm trying to do Inheritance of properties and extending of them on another schema by using allOf, but instead of the object, the null is shown

I even tried it with the example, but still got the same result

example: https://swagger.io/docs/specification/v3_0/data-models/inheritance-and-polymorphism/#model-composition

Image

^ null should be the

{
  "message": "string",
  "code": 0,
  "rootCause": "string"
}

my schema

## Same as in example

BasicErrorModel:
  type: object
  required:
    - message
    - code
  properties:
    message:
      type: string
    code:
      type: integer
      minimum: 100
      maximum: 600
ExtendedErrorModel:
  allOf: # Combines the BasicErrorModel and the inline model
    - $ref: "#/components/schemas/BasicErrorModel"
    - type: object
      required:
        - rootCause
      properties:
        rootCause:
          type: string

## I'm trying to use it
## BasicErrorModel is working as expected, but ExtendedErrorModel is not

ICommentReleasePagedResponse:
  type: object
  properties:
    code:
      "$ref": "#/components/schemas/DefaultResult"
    content:
      type: array
      items:
        "$ref": "#/components/schemas/ExtendedErrorModel"
    total_count:
      type: integer
      example: 0
    total_page_count:
      type: integer
      example: 0
    current_page:
      type: integer
      example: 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions