Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing properties after upgrade 1.21.0 to 1.21.1 #422

Closed
frodeaa opened this issue Feb 23, 2018 · 1 comment
Closed

Missing properties after upgrade 1.21.0 to 1.21.1 #422

frodeaa opened this issue Feb 23, 2018 · 1 comment

Comments

@frodeaa
Copy link

frodeaa commented Feb 23, 2018

Upgrade from 1.21.0 to 1.21.1 breaks request body properties
for swagger file where allOf is used

1.21.0
1 21 0

1.21.1
1 21 1

{
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "swagger": "2.0",
  "info": {
    "description": "",
    "title": "",
    "version": "2018-02-23"
  },
  "basePath": "/v1",
  "paths": {
    "/users": {
      "post": {
        "summary": "",
        "parameters": [
          {
            "name": "data",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "allOf": [
                {
                  "$ref": "#/definitions/AuthUser"
                },
                {
                  "required": [
                    "password"
                  ],
                  "properties": {
                    "password": {
                      "description": "The user's password",
                      "type": "string",
                      "minLength": 8
                    }
                  }
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "user created",
            "schema": {
              "$ref": "#/definitions/AuthUser"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "AuthUser": {
      "type": "object",
      "allOf": [
        {
          "$ref": "#/definitions/Entity"
        },
        {
          "required": [
            "username"
          ],
          "properties": {
            "username": {
              "type": "string"
            }
          }
        }
      ]
    },
    "Entity": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "example": "1234"
        }
      }
    }
  },
  "parameters": {}
}
consumes:
  - application/json
produces:
  - application/json
swagger: '2.0'
info:
  description: ''
  title: ''
  version: '2018-02-23'
basePath: /v1
paths:
  /users:
    post:
      summary: ''
      parameters:
        - name: data
          in: body
          required: true
          schema:
            type: object
            allOf:
              - $ref: '#/definitions/AuthUser'
              - required:
                  - password
                properties:
                  password:
                    description: The user's password
                    type: string
                    minLength: 8
      responses:
        '200':
          description: user created
          schema:
            $ref: '#/definitions/AuthUser'
definitions:
  AuthUser:
    type: object
    allOf:
      - $ref: '#/definitions/Entity'
      - required:
          - username
        properties:
          username:
            type: string
  Entity:
    type: object
    properties:
      id:
        type: string
        example: '1234'
parameters: {}
@frodeaa frodeaa changed the title Missing properties after upgrade to 1.21.1 Missing properties after upgrade 1.21.0 to 1.21.1 Feb 23, 2018
@RomanHotsiy
Copy link
Member

RomanHotsiy commented Feb 26, 2018

@frodeaa thanks for reporting and for detailed test-case!

version v1.21.2 has just been released

frodeaa added a commit to frodeaa/ReDoc that referenced this issue Jun 15, 2018
resets the readOnly/writeOnly to default (undefined)
before merging it with next subschema

ref: Redocly#532
rel: Redocly#422
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants