Hi Ron,
I m also facing the same issue. I have pasted my yaml code. Please look 
into it.
✖ Swagger Error 

Not a valid parameter definition
Jump to line *139* 
Details 
Object 
code: "ONE_OF_MISSING" 
params: Array [0] 
message: "Not a valid parameter definition" 
path: Array [5] 
schemaId: "http://swagger.io/v2/schema.json#"; 
inner: Array [2] 
level: 900 
type: "Swagger Error" 
description: "Not a valid parameter definition" 
lineNumber: 139 
✖ Swagger Error 

Not a valid parameter definition
Jump to line *120* 
Details 
Object 
code: "ONE_OF_MISSING" 
params: Array [0] 
message: "Not a valid parameter definition" 
path: Array [5] 
schemaId: "http://swagger.io/v2/schema.json#"; 
inner: Array [2] 
level: 900 
type: "Swagger Error" 
description: "Not a valid parameter definition" 
lineNumber: 120 

swagger: "2.0"
info:
  version: "0.0.1"
  title: User Operations
# during dev, should point to your local machine
host: localhost:10010
# basePath prefixes all resource paths 
basePath: /
# 
schemes:
  # tip: remove http to make production-grade
  - http
  - https
# format of bodies a client can send (Content-Type)
consumes:
  - application/json
# format of the responses to the client (Accepts)
produces:
  - application/json
paths:
  /user/source:
    # binds a127 app logic to a route
    x-swagger-router-controller: source
    get:
      description: Returns list of Users
      # used as the method name of the controller
      operationId: getAll
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/User"
        # responses may fall through to errors
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
    put:
      summary: to edit Users details 
      description: edit all the users to database
      operationId: save
      parameters:
        - name: edit user details
          in: body
          required: true
          schema:
            $ref: "#/definitions/User"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/GeneralResponse"
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
  /user/source/{sourceId}:
    x-swagger-router-controller: userlist
    get:
      operationId: getOne
      description: get a movie
      # define the type of response for Success "200" and Error
      parameters:
        - name: sourceId
          type: string
          in: path
          required: true
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/GenearalResponse"
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
    put:
      operationId: update
      description: update a user
      # define the parameters
      parameters:
        - name: sourceName
          description: User Properties
          in: body
          required: true
          schema:
            $ref: "#/definitions/User"
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/GeneralResponse"
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
    delete:
      operationId: delUser
      description: remove a user from database
      parameters: 
        - name: sourceId
          description: enter Unique sourceId
          type: string
          in: path
          required: true
      responses:
        "200":
          description: Success
          schema:
            $ref: "#/definitions/GeneralResponse"
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
  /user/source/{sourceId}/schema:
    put:
      summary: A brief summary of the operation.
      description: A brief summary of the operation.
      operationId: saveKeyValue
      parameters:
        - name: sourceId
          description: enter Unique sourceId
          in: path
          required: true
          schema:
            $ref: "#/definitions/User"
      responses:
        "200":
          description: success
          schema:
            $ref: "#/definitions/GeneralResponse"
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
    get:
      description: get the particular user information
      operationId: getSchema
      parameters: 
        - name: sourceId
          description: enter Unique sourceId
          type: string
          in: path
          required: true
          schema:
            $ref: "#/definitions/User"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/GeneralResponse"
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
  /swagger:
    x-swagger-pipe: swagger_raw
# complex objects have schema definitions
definitions:
  Schema:
    properties:
      key:
        type: string
      value:
        type: string
  User:
    required:
      - sourcename
      - sourceId
      - sourceType
    properties: 
      sourcename:
        type: string
      sourceId:
        type: string
      sourceDescription:
        type: string
      sourceType:
        type: string
      sourceSchema:
        type: object
        additionalProperties:
          type: string
  GeneralResponse:
    type: object
    properties:
      success:
        type: number
        description: returns 1 if successful
      description:
        type: string
        description: a short comment 
    required:
      - success
      - description
  ErrorResponse:
    required:
      - message
    properties:
      message:
        type: string


On Tuesday, October 31, 2017 at 12:54:51 AM UTC+5:30, Ron wrote:
>
> Valid JSON doesn’t mean it’s a valid OpenAPI document.
>
> In order to point you to the issue, we need to see the full definition.
>
>  
>
>  
>
>  
>
> *From: *<swagger-sw...@googlegroups.com <javascript:>> on behalf of Vinay 
> Banakar <vinay.s...@gmail.com <javascript:>>
> *Reply-To: *"swagger-sw...@googlegroups.com <javascript:>" <
> swagger-sw...@googlegroups.com <javascript:>>
> *Date: *Monday, October 30, 2017 at 01:28
> *To: *Swagger <swagger-sw...@googlegroups.com <javascript:>>
> *Subject: *Schema error should NOT have additional properties 
> additionalProperty: @odata.context, @odata.etag
>
>  
>
>
> Hello, 
>
> I am using http://editor.swagger.io, wheere I have a validated JSON file 
> I am trying to create a pojo of it. But when I copy the json to the editor 
> it prompts me to convert it to YAML, once that's done the editor throws the 
> bellow error. 
> Schema error 
>
> should NOT have additional properties
>
> additionalProperty: @odata.context, @odata.etag, @odata.id, @odata.type
>
> But it  is a valid JSON data, can someone help me figure out why I am 
> encountering this error to beign with?
>
> Thank you
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Swagger" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to swagger-swaggersocket+unsubscr...@googlegroups.com <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to