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 line break doesn't always trigger a validation error #1740

Open
webron opened this issue Apr 17, 2018 · 3 comments
Open

Missing line break doesn't always trigger a validation error #1740

webron opened this issue Apr 17, 2018 · 3 comments

Comments

@webron
Copy link
Contributor

webron commented Apr 17, 2018

Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 2.0 (could be 3.0 as well)
Which Swagger-Editor version? 3.5.2
How did you install Swagger-Editor? Online editor
Which browser & version? FF 61 (Nightly)
Which operating system? MacOS

Demonstration API definition

swagger: '2.0'
info:
  description: Weird validation bug
  version: "1.0.0"
  title: Validation Bug
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html

paths:
  /item/{dbId}:
    get:
      operationId: itemUse
      parameters:
      - in: path
        name: dbId
        required: true 
        description: 'bug!' type: string
      responses:
        '200':
          description: sucessful response

Expected Behavior

It should complain that either the YAML structure is invalid, or that the parameter is missing a type definition.

Notice that this only happens if the description is quoted, for obvious reasons, and it won't happen with fields other than string type.

Current Behavior

It ignores any validation issue and says it's all 🍑y.

Possible Solution

No idea, can't even fathom the cause.

Context

It doesn't work, @shockey.

@shockey
Copy link
Contributor

shockey commented Apr 19, 2018

Looks like js-yaml is actually letting this be parsed correctly, even though the YAML is invalid:

@shockey
Copy link
Contributor

shockey commented Apr 19, 2018

Closing in favor of nodeca/js-yaml#418.

@shockey
Copy link
Contributor

shockey commented Apr 23, 2018

MOAR issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants