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

Incorrect validation marker location #32

Closed
tfesenko opened this issue Dec 2, 2015 · 2 comments
Closed

Incorrect validation marker location #32

tfesenko opened this issue Dec 2, 2015 · 2 comments

Comments

@tfesenko
Copy link
Member

tfesenko commented Dec 2, 2015

Take this model and try to find what's wrong with it.
The validation marker points to line 14:
screen shot 2015-12-02 at 6 03 57 pm

However, the error (the only error) is on line 33 - schema: which missing the $ref.

Model:

swagger: "2.0"
info:
  description: "Tax Blaster"
  version: "1.0.0"
  title: "TaxBlaster"
host: "taxblaster.com"
basePath: "/api"
tags:
- name: "TaxFilingObject"
  description: "An individual Tax Filing record, accessed by its ID"
schemes:
- "http"
paths:
  /taxFilings/{id}:
    get:
      tags:
      - "TaxFilingObject"
      description: ""
      operationId: "getTaxFiling"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "id"
        in: "path"
        description: "filingID of the requested TaxFiling"
        required: true
        type: "string"
      responses:
        200:
          description: ""
          schema:
        404:
          description: ""
    parameters:
    - name: "id"
      in: "path"
      description: "filingID of the requested TaxFiling"
      required: true
      type: "string"

definitions:
  TaxFilingObject:
    type: "object"
    description: "An individual Tax Filing record, accessed by its ID"
    properties:
      filingID:
        type: "string"
      jurisdiction:
        type: "string"
      year:
        type: "string"
      period:
        type: "integer"
      currency:
        type: "string"
      grossIncome:
        type: "number"
      taxLiability:
        type: "number"
      taxpayer:
        type: "object"
@tfesenko
Copy link
Member Author

tfesenko commented Dec 2, 2015

Similar with this model:

swagger: "2.0"
info:
  description: "Tax Blaster"
  version: "1.0.0"
  title: "TaxBlaster"
host: "taxblaster.com"
basePath: "/api"
tags:
- name: "TaxFilingObject"
  description: "An individual Tax Filing record, accessed by its ID"
schemes:
- "http"
paths:
  /taxFilings/{id}:
    get:
      tags:
      - "TaxFilingObject"
      description: ""
      operationId: "getTaxFiling"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "id"
        in: "path"
        description: "filingID of the requested TaxFiling"
        required: true
        type: "string"
      responses:
        200:
          description: ""
          schema:
            $ref: ""
        404:
          description: ""
    put:
      description: ""
    parameters:
    - name: "id"
      in: "path"
      description: "filingID of the requested TaxFiling"
      required: true
      type: "string"

definitions:
  TaxFilingObject:
    type: "object"
    description: "An individual Tax Filing record, accessed by its ID"
    properties:
      filingID:
        type: "string"
      jurisdiction:
        type: "string"
      year:
        type: "string"
      period:
        type: "integer"
      currency:
        type: "string"
      grossIncome:
        type: "number"
      taxLiability:
        type: "number"
      taxpayer:
        type: "object"

It's very difficult to find the real source of the problem

PS In this case the problems is in the put method on line 38.

@tfesenko
Copy link
Member Author

tfesenko commented Dec 2, 2015

We can start with adding tests for these cases. And then fix them.

@tfesenko tfesenko added this to the Release 1.0 milestone Dec 3, 2015
ghillairet added a commit that referenced this issue Dec 4, 2015
tfesenko added a commit that referenced this issue Dec 4, 2015
[#32] Incorrent validation marker location
@tfesenko tfesenko closed this as completed Dec 4, 2015
@tedepstein tedepstein changed the title Incorrent validation marker location Incorrect validation marker location Feb 8, 2016
tfesenko added a commit that referenced this issue May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant