question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parameters using $ref are not validated

See original GitHub issue

Given a path such as:

  /pets/{id}:
    get:
      description: Returns a user based on a single ID, if the user does not have access to the pet
      operationId: find pet by id
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: pet response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pet'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

And a component:

components:
  parameters:
    id:
      name: id
      in: path
      description: ID of pet to fetch
      required: true
      schema:
        type: integer
        format: int64

The parameter isn’t validated.

I’m not sure if that is a design decision or something that will be supported in future? Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
willmorgancommented, Jul 9, 2019

@nkemp and I are seeing the same (or similar) issue with requestBody and using $ref also.

0reactions
cdimasciocommented, Jul 4, 2019

note, kogosoftwarellc/open-api#483 is not resolved, however, v1.1.0 now has a workaround in place

Read more comments on GitHub >

github_iconTop Results From Across the Web

Required response parameters not validated if they ... - GitHub
I just made extra tests. The problem occurs when I add a reference inside another reference. If SomeDefinition has no other reference, the ......
Read more >
Resolve the "Parameter validation failed" error in AWS ...
How do I resolve the "Parameter validation failed: parameter value 'abc' for parameter name 'ABC' does not exist" error in CloudFormation?
Read more >
When to use ref and when it is not necessary in C# - Stack ...
Long answer: when a reference type parameter is passed by value, only the reference is passed, not a copy of the object. This...
Read more >
Params::Validate - Validate method/function parameters
); The callback should return a true value if the value is valid. If not, it can return false or die ...
Read more >
CWE-20: Improper Input Validation (4.9) - MITRE
The product receives input or data, but it does not validate or ... Caution must be used when referencing this CWE entry or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found