question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

should NOT have additional properties

See original GitHub issue

when i compare my stuff with your pet application i can’t see the difference

Q A
Bug or feature request? bug
Which Swagger/OpenAPI version? swagger 20
Which Swagger-Editor version? current : downloaded from github yesterday
How did you install Swagger-Editor? npm
Which broswer & version? vivaldi
Which operating system? windows7

Demonstration API definition

swagger: '2.0'
info:
  description: This is a TFMS server.
  version: 1.0.0
  title: TFMS Public Services
  termsOfService: 'http://avl.com/tfms/terms/'
  contact:
    email: tfms@swagger.io
  license:
    name: AVL license
    url: 'http://www.avl.com/'
host: petstore.swagger.io
basePath: /v2
tags:
  - name: TFMS
    description: Testfield Management Services
    externalDocs:
      description: Find out more
      url: 'http://tfms.com'
  - name: search
    description: Search operations
  - name: masterdata
    description: Operations on masterdata tables
    externalDocs:
      description: Find out more about our store
      url: 'http://swagger.io'
  - name: testequipment
    description: Operations about testequipment instances
    externalDocs:
      description: Find out more about our store
      url: 'http://swagger.io'
  - name: testorder
    description: Operations about testorders
    externalDocs:
      description: Find out more about our store
      url: 'http://swagger.io'
  - name: calibration
    description: Operations about calibrations of objects
    externalDocs:
      description: Find out more about our store
      url: 'http://swagger.io'
  - name: maintenance
    description: Operations about maintenances of objects
  - name: pet
    description: obsolete
    externalDocs:
      description: Find out more about our store
      url: 'http://swagger.io'
schemes:
  - http
paths:
  /search:
    get:
      tags:
        - search
      summary: central search using paco query
      description: allows to search for all businessobjects
      operationId: searchByDefaultQuery
      produces:
        - application/xml
        - application/json
      parameters:
        - name: criteria
          type: string
          in: query
          required: true
        - name: attributes
          type: string
          in: query
          required: false
      responses:
        '200':
          description: successful operation
          schema:
            type: array
            items:
              $ref: '#/definitions/Reference'
  /search/mongoQuery:
    get:
      tags:
        - search
      summary: search for objects using a valid mongo statement
      description: allows to search for all businessobjects using mongo statements
      operationId: searchByMongo
      produces:
        - application/xml
        - application/json
      parameters:
        - name: criteria
          in: query
          type: string
          required: true
      responses:
        '200':
          description: successful operation
          schema:
            type: array
            items:
              $ref: '#/definitions/Reference'
  /search/tfmsQuery:
    get:
      tags:
        - search
      summary: central search using paco query
      description: allows to search for all businessobjects using mongo statements
      operationId: searchByPacoQuery
      produces:
        - application/xml
        - application/json
      parameters:
        - name: criteria
          in: query
          type: string
          required: true
        - name: attributes
          in: query
          type: string
          required: false
      responses:
        '200':
          description: successful operation
          schema:
            type: array
            items:
              $ref: '#/definitions/Reference'          
  /masterdata:
    get:
      tags:
        - masterdata
      summary: returns all table names + uri's (singular name in contact)
      responses:
        '200':
          description: successful operation
          schema:
            type: array
            items:
              $ref: '#/definitions/Reference' 

  /masterdata/{recordType}:
    get:
      tags:
        - masterdata
      summary: return table records (paginated)
      parameters:
        - name: recordType
          in: path
          required: true
          type: string
          decription: not the plural table name but singular type name of record
        - name: pageSize
          in: query
          type: int
          required: false
          decription: records in one page
        - name: page
          in: query
          type: int
          required: false
          decription: requested page
        - name: sort
          in: query
          type: string
          required: false
          decription: could be columname:1,columnname:-1,..
        - name: filter
          in: query
          type: string
          required: false
          decription: could be columname:filter1,columnname:filter2,..
      responses:
        '200':
          description: successful operation
          schema:
            type: array
            items:
              $ref: '#/definitions/Record' 
        '404':
          description: not found
    put:
      tags:
        - masterdata
      summary: updates, deletes, adds records in bulk operations
      responses:
        '200':
          description: successful operation

  /web/masterdata:
    get:
      tags:
        - masterdata
      summary: UI method for update attribute / script on a single record
      parameters:
        - name: attributeName
          in: body
          type: string
          required: true
        - name: recordObj
          in: body
          required: true  
      responses:
        '200':
          description: successful operation + update record

  /testequipment:
    get:
      tags:
        - testequipment
      summary: returns all testequipments in store (conflicts a kind of with search)
      responses:
        '200':
          description: successfull
    post:
      tags:
        - testequipment
      summary: adds a testequipments into store, expects full objects
      parameters:
        - name: testequipmentObj
          in : body
          required: true
      responses:
        '200':
          description: successfull + new Id / + new Uri
  '/testequipment/{tfmsId}':
    get:
      tags:
        - testequipment
      summary: returns testequipment with given id (maintenance, calibration etc. not part of object, only uri's to related list of maintenances, one uri per maintenanceType)
      parameters:
        - name: tfmsId
          in: path
          required: true
          type: integer
          format: int64
      responses:
        '200':
          description: successfull
    put:
      tags:
        - testequipment
      summary: updates testequipment
      responses:
        '200':
          description: successfull
    delete:
      tags:
        - testequipment
      summary: deletes testequipment
      responses:
        '200':
          description: successfull
    patch:
      tags:
        - testequipment
      summary: partially updates testequipment
      responses:
        '200':
          description: successfull

  /web/testequipment:
    post: 
      tag:
        - testequipment
      summary: create method for WebUI, only tet is mandatory, returns id + uri to newly created object
    get: 
      tag:
        - testequipment
      summary: send partial updates, server merges, validates, does some logic, returns delta back, DOES NOT SAVE

  /testorder:
    get:
      tags:
        - testorder
      summary: returns all testorders in store
      responses:
        '200':
          description: successfull
    post:
      tags:
        - testorder
      summary: adds a testorder into store
      responses:
        '200':
          description: successfull
  '/testorder/{tfmsId}':
    get:
      tags:
        - testorder
      summary: return one testorder (?without steps only links to steps?)
      parameters:
        - name: tfmsId
          in: path
          required: true
          type: integer
          format: int64
      responses:
        '200':
          description: successfull
    put:
      tags:
        - testorder
      summary: updates one testorder
      responses:
        '200':
          description: successfull
    delete:
      tags:
        - testorder
      summary: deletes on testorder
      responses:
        '200':
          description: successfull
  /step:
    get:
      tags:
        - testorder
      summary: dedicated endpoint for steps. we are not sure if this is good, due to validation issues. it might make sense to have this only for UI-REST

  /web/testorder:
    get:
      tags:
        - testorder
      summary: UI testorder without step detail - information

  /web/step:
    get:
      tags:
        - testorder
      summary: UI endpoint to load (and save ?) step separately

  /maintenance:
    get:
      tags:
        - maintenance
      summary: returns filtered maintenances in store
      parameters:
        - name: resourceId
          in: query
          required: true
        - name: maintenanceTypeName
          in : query
          type: string
          required: false
        - name: position
          in : query
          type: string
          description: last / all / specific index
          required: false
      responses:
        '200':
          description: successfull  
    post:
      tags:
        -  maintenance
      summary: stores a new maintenance, as content we need maintenanceTypeName and resourceId
      parameters:
      - name: maintenaceObj
        in: body
        required: true
      responses:
        '200':
          description: successfull

  '/maintenance/{maintenanceId}':
    get:
      tags:
        - maintenance
      summary: returns all maintenances of given object
      parameters:
        - name: maintenanceId
          in: path
          required: true
          type: integer
          format: int64
      responses:
        '200':
          description: successfull
    put:
      tags:
        - maintenance
      summary: update existing maintenance (info which one is needed)
      responses:
        '200':
          description: successfull
    delete:
      tags:
        - maintenance
      summary: delete existing maintenance (info which one is needed)
      responses:
        '200':
          description: successfull          
  '/maintenance/add':
    get:
      tags:
        - maintenance
      summary: 'UI/client helper: returns a prefilled maintenance (for a later post)'
      parameters:
        - name: resourceId
          in: query
          required: true
        - name: maintenanceTypeName
          in : query
          type: string
          required: true
      responses:
        '200':
          description: successfull
  /calibration:
    get:
      tags:
        - calibration
      summary: 
      parameters:
        - name: resourceId
          in: query
          required: true
        - name: channelName
          in : query
          type: string
          required: true          
          description:          
        - name: calibrationTypeName
          in : query
          type: string
          description: in case we habe multiple calibrations with different intervals
          required: false
        - name: position
          in : query
          type: string
          description: last / all / specific index
          required: false
      responses:
        '200':
          description: successfull  
      
securityDefinitions:
  tfms_auth:
    type: oauth2
    authorizationUrl: 'http://tfms.avl.com/session/dialog'
    flow: implicit
    scopes:
      'write:pets': modify pets in your account
      'read:pets': read your pets
  api_key:
    type: apiKey
    name: api_key
    in: header
definitions:
  Reference:
    type: object
    required:
      - id
      - name
      - type
      - uri
    properties:
      id:
        type: integer
        format: int64
        example: 125643
      type:
        type: string
        example: TestOrder
      name:
        type: string
        example: doggie
      uri:
        type: string
      state:
        type: string
        description: resource state in the store
        enum:
          - available
          - created
          - closed
    xml:
      name: TfmsReference
  Record:
    type: object
    required:
      - id
      - name
      - type
      - uri
    properties:
      id:
        type: integer
        format: int64
        example: 125643
      type:
        type: string
        example: Contact
      name:
        type: string
        example: AVL
    xml:
      name: Record      
  Order:
    type: object
    properties:
      id:
        type: integer
        format: int64
      petId:
        type: integer
        format: int64
      quantity:
        type: integer
        format: int32
      shipDate:
        type: string
        format: date-time
      status:
        type: string
        description: Order Status
        enum:
          - placed
          - approved
          - delivered
      complete:
        type: boolean
        default: false
    xml:
      name: Order
  Category:
    type: object
    properties:
      id:
        type: integer
        format: int64
      name:
        type: string
    xml:
      name: Category
  User:
    type: object
    properties:
      id:
        type: integer
        format: int64
      username:
        type: string
      firstName:
        type: string
      lastName:
        type: string
      email:
        type: string
      password:
        type: string
      phone:
        type: string
      userStatus:
        type: integer
        format: int32
        description: User Status
    xml:
      name: User
  Tag:
    type: object
    properties:
      id:
        type: integer
        format: int64
      name:
        type: string
    xml:
      name: Tag
  ApiResponse:
    type: object
    properties:
      code:
        type: integer
        format: int32
      type:
        type: string
      message:
        type: string
externalDocs:
  description: Find out more about Swagger
  url: 'http://swagger.io'

Configuration (browser query string, constructor, config.yaml)

{
  "your": { "constructorConfig": "here" }
}

?yourQueryStringConfig=here

Expected Behavior

no error 😉

Current Behavior

it shows error that i find not reasonable

Possible Solution

Context

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

15reactions
webroncommented, Dec 1, 2017

@mroach fwiw, fixing and improving the error messages is a high priority for us, hopefully would have a major improvement within a couple of weeks.

8reactions
hkosovacommented, Oct 6, 2017

Typos: type: int -> type: integer decription -> description tag -> tags

Some summary and description fields don’t have a value Some body parameters are missing a schema Some query parameters are missing a type Some operations are missing responses

/web/masterdata - you cannot have more than one body parameter

Please refer to our guide on how to write API definitions - https://swagger.io/docs/specification/2-0/basic-structure/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swagger Editor shows the "Schema error: should NOT have ...
openapi - Swagger Editor shows the "Schema error: should NOT have additional properties" error for a path parameter - Stack Overflow. Stack Overflow...
Read more >
"Should not have additional property" error even t...
Hello everyone, i am trying to add schema and I keep getting error that I have additional property even though I am following...
Read more >
Should NOT have additional properties: component ... - GitHub
The swagger editor does not seem to be parsing OAS3 responses correctly. I have the following yaml: swagger: '2.0' info: title: Document ...
Read more >
UISP Swagger 2.0 API Not Validating - Ubiquiti Community
user.put.responses.200.schema should NOT have additional properties additionalProperty: x-alternatives Jump to line 965 Structural error at paths.
Read more >
Request.body should NOT have additional properties
body should NOT have additional properties”}. It doesn't work even in n8n API playground. Can't share here the JSON that I'm using to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found