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

parameters from "endpoint level" are not taken into account #17

Open
Leemur89 opened this issue Apr 16, 2024 · 1 comment
Open

parameters from "endpoint level" are not taken into account #17

Leemur89 opened this issue Apr 16, 2024 · 1 comment

Comments

@Leemur89
Copy link

Hello,

Parameters can be in the OAS at both endpoint level, and method level.
For parameters at method level, they are well taken into account in data mapping. However for endpoint level, they are not being filled at all.

Example:

{
    "/my/endpoint": {
      "parameters": [
          {
            "description": "This is at endpoint level",
            "in": "header",
            "name": "endpoint-header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
      ],
      "post": {
        "parameters": [
          {
            "description": "This is at method level",
            "in": "header",
            "name": "method-specific-header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        (...)

The library will only consider the header method-specific-header, not the endpoint-header
I'm not 100% sure that this kind of OAS is valid though :/

@robinmackaij
Copy link
Collaborator

I'm pretty sure it's valid in the OAS but I did not previously spend effort on supporting this. The OAS offers many options like this that generally not seen in production (since most OAS specs are generated by frameworks and not hand-crafted).

That being said, I can definitely see about supporting this if you need it (and a PR is of course welcome).

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

2 participants