Skip to content

Latest commit

 

History

History
69 lines (65 loc) · 1.83 KB

File metadata and controls

69 lines (65 loc) · 1.83 KB

array merge recursive distinct

While resolving allOfs (pull request #208), if a duplicate property is found

components:
  schemas:
    User:
      type: object
      required:
        - id
        - name # <--------------------------------------------------------------
      properties:
        id:
          type: integer
        name: # <--------------------------------------------------------------
          type: string
          maxLength: 10 # <--------------------------------------------------------------
    Pet:
      type: object
      required:
        - id2
        - name # <--------------------------------------------------------------
      properties:
        id2:
          type: integer
        name: # <--------------------------------------------------------------
          type: string
          maxLength: 12 # <--------------------------------------------------------------
    Post:
      type: object
      properties:
        id:
          type: integer
        content:
          type: string
        user:
          allOf:
            - $ref: '#/components/schemas/User'
            - $ref: '#/components/schemas/Pet'
            - x-faker: true

then property from the last component schema will be considered:

Post:
  type: object
  properties:
    id:
      type: integer
    content:
      type: string
    user:
      type: object
      required:
        - id
        - name # <--------------------------------------------------------------
        - id2
      properties:
        id:
          type: integer
        name: # <--------------------------------------------------------------
          type: string
          maxLength: 12 # <--------------------------------------------------------------
        id2:
          type: integer
      x-faker: true