Swagger-editor: using openapi 3.0 and getting errors with valid yaml

Created on 27 Sep 2017  路  8Comments  路  Source: swagger-api/swagger-editor

Using deepObjects for POST query params that Swagger 2.0 did not support. But can't make sense of the errors.

Here's the yaml:

openapi: 3.0.0
info:
  version: "1.0.0-oas3"
  title: Stagirite Scheduler
paths:
  /lycronjobservlet/create:
    post:
      consumes:
        - application/x-www-form-urlencoded
      produces:
        - application/json
      parameters:
        - in: query
          name: identity
          description: cognito identity of the user
          required: true
          type: string
        - in: query
          name: params
          description: the stringified json version of the params
          required: true
          schema:
            $ref: '#/definitions/CreateParams'
          style: deepObject
          explode: true
      responses:
        '200':
          description: >-
            operation is always successful but response contains success or
            error data
          schema:
            $ref: '#/definitions/CreateUpdateResponse'
definitions:
  CronMeta:
    type: object
    properties:
      id:
        type: string
      name:
        type: string
      expressions:
        type: array
        items:
          type: string
      urls:
        type: array
        items:
          type: string
      numUrls:
        type: integer
        format: int32
      startAt:
        type: integer
        format: int64
      endAt:
        type: integer
        format: int64
      isPaused:
        type: boolean
      lastJobId:
        type: string
      misfireError:
        type: string
      numFinished:
        type: integer
        format: int32
      numFailed:
        type: integer
        format: int32
      isRunning:
        type: boolean
      fireAt:
        type: integer
        format: int64
  CreateParams:
    type: object
    required:
      - expressions
      - urls
    properties:
      name:
        type: string
      expressions:
        type: array
        items:
          type: string
      urls:
        type: array
        items:
          type: string
      startAt:
        type: integer
        format: int64
      endAt:
        type: integer
        format: int64
      isPaused:
        type: boolean
  ResponseFailure:
    type: object
    required: null
    properties:
      exception:
        type: object
        properties:
          name:
            type: string
          message:
            type: string
          trace:
            type: string
      error:
        type: object
        properties:
          type:
            type: string
          message:
            type: string
          trace:
            type: string
  CreateUpdateResponse:
    type: object
    required:
      - isError
    properties:
      isError:
        type: boolean
      failure:
        $ref: '#/definitions/ResponseFailure'
      resultData:
        $ref: '#/definitions/CronMeta'

Here's the errors:
Errors

Schema error
should NOT have additional properties
additionalProperty: definitions
Jump to line 0
Schema error at paths['/lycronjobservlet/create'].post
should NOT have additional properties
additionalProperty: consumes, produces
Jump to line 7
Schema error at paths['/lycronjobservlet/create'].post.parameters[0]
should NOT have additional properties
additionalProperty: type
Jump to line 13
Schema error at paths['/lycronjobservlet/create'].post.parameters[0].in
should be equal to one of the allowed values
allowedValues: path, header, cookie
Jump to line 13
Schema error at paths['/lycronjobservlet/create'].post.responses['200']
should NOT have additional properties
additionalProperty: schema
Jump to line 27
Schema error at paths['/lycronjobservlet/create'].post.responses['200']
should have required property '$ref'
missingProperty: $ref
Jump to line 27
Schema error at paths['/lycronjobservlet/create'].post.responses['200']
should match exactly one schema in oneOf
Jump to line 27

support

Most helpful comment

You're mixing 2.0 with 3.0.0 here. 3.0.0 doesn't have definitions, it has components\schemas. You'd need to modify your definition and references to make it work.

All 8 comments

You're mixing 2.0 with 3.0.0 here. 3.0.0 doesn't have definitions, it has components\schemas. You'd need to modify your definition and references to make it work.

@andynuss, is there still something we can help with here?

Yes, I can't get things to deploy to aws.聽 That's why I opened the case.聽 Initially I was using openapi wrong.聽 Then I went back to swagger 2.0.聽 Everything seemed to compile and I set up the links to aws.聽 But it didn't go thru to API gateway.聽 Then by accident, I deleted the spec, or something and restored from github.聽 Now there's a 1.0.1 that is editable and a 1.0.0 that is frozen.聽 Don't know why there is a 1.0.1, which does not have the aws linkage setup, but 1.0.0 does not deploy to aws api gateway as I said.The url:https://app.swaggerhub.com/apis/Stagirite/stag-scheduler/1.0.0

-------- Original Message --------
Subject: Re: [swagger-api/swagger-editor] using openapi 3.0 and getting
errors with valid yaml (#1512)
From: kyle notifications@github.com
Date: Mon, October 02, 2017 10:26 am
To: swagger-api/swagger-editor swagger-editor@noreply.github.com
Cc: andynuss andy@stagirite.com, Mention mention@noreply.github.com

@andynuss, is there still something we can help with here? 鈥擸ou are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

I have updated smart bear case:00258376

-------- Original Message --------
Subject: Re: [swagger-api/swagger-editor] using openapi 3.0 and getting
errors with valid yaml (#1512)
From: kyle notifications@github.com
Date: Mon, October 02, 2017 10:26 am
To: swagger-api/swagger-editor swagger-editor@noreply.github.com
Cc: andynuss andy@stagirite.com, Mention mention@noreply.github.com

@andynuss, is there still something we can help with here? 鈥擸ou are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

My browser error console gives this when I try to deploy:

XML Parsing Error: no root element found
Location: https://app.swaggerhub.com/apiproxy/plugins/configurations?trigger=true
Line Number 1, Column 1:

Got it to work finally.

@andynuss, glad to hear you got it working.

For future reference, we're unable to give support for SwaggerHub here. The SwaggerHub team should be able to help you though :smile:

Closing!

You're mixing 2.0 with 3.0.0 here. 3.0.0 doesn't have definitions, it has components\schemas. You'd need to modify your definition and references to make it work.

You made my day ! Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SteveNewhouse picture SteveNewhouse  路  5Comments

alecmev picture alecmev  路  4Comments

gerbsen picture gerbsen  路  3Comments

delim29 picture delim29  路  4Comments

marcopiraccini picture marcopiraccini  路  3Comments