Skip to content

Pattern wrapped by double quote is showing error #2183

@dhaval-mehta

Description

@dhaval-mehta

Sample Image

Original Issue link: encode/django-rest-framework#7204

YAML which is not throwing error:

swagger: '2.0'
info:
  description: ''
  version: 1.0.5
  title: Swagger Petstore
  termsOfService: 'http://swagger.io/terms/'
  contact:
    email: apiteam@swagger.io
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
host: petstore.swagger.io
basePath: /v2
tags:
  - name: pet
    description: Everything about your Pets
paths:
  /pet:
    post:
      tags:
        - pet
      summary: Add a new pet to the store
      description: ''
      operationId: addPet
      consumes:
        - application/json
      produces:
        - application/json
      responses:
        200:
          description: ''
          schema:
            $ref: '#/definitions/Pet'

definitions:
  Pet:
    type: object
    required:
      - name
      - photoUrls
    properties:
      id:
        type: integer
        format: int64
      name:
        type: string
        example: doggie
        pattern: '^(\d+\.)?(\d+\.)?(\*|\d+)$'
      photoUrls:
        type: array
        xml:
          wrapped: true
        items:
          type: string
          xml:
            name: photoUrl
      status:
        type: string
        description: pet status in the store
        enum:
          - available
          - pending
          - sold
    xml:
      name: Pet

Just replace single quote by double quote and error will come.

for example: '^(\d+\.)?(\d+\.)?(\*|\d+)$' => "^(\d+\.)?(\d+\.)?(\*|\d+)$"'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions