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

Parameter validation too strict #1063

Closed
devluencer-089 opened this issue Mar 27, 2019 · 2 comments
Closed

Parameter validation too strict #1063

devluencer-089 opened this issue Mar 27, 2019 · 2 comments

Comments

@devluencer-089
Copy link

#960 introduced a bug:

This appears to be a valid definition:

  /customers/{id}/legal-person/addresses/{addressId}:
    parameters:
      - $ref: "#/components/parameters/id"
      - $ref: "#/components/parameters/addressId"

But results in the following messages after Parsing:

attribute paths.'/customers/{id}/legal-person/addresses/{addressId}'.There are duplicate parameter values

Code:

 val parseResult = OpenAPIV3Parser().readWithInfo("http://localhost:8080/swagger/openapi.yaml", emptyList())

            val errors = parseResult.messages.joinToString(separator = System.getProperty("line.separator"))
            print(errors)

@cvgaviao
Copy link
Contributor

cvgaviao commented Mar 30, 2019

Hello @jakubmalek, I did validate your patch and confirmed that it fixed the validation messages that I was facing with multiple parameter references at #1066.
But I'm wondering...
Why I'm getting a parameter with null values (including its name) when I do:

PathItem path = api.getPaths().get("/anPath/{anParameter}");
Parameter anParam = path.getParameters().get(0);
assertThat(anParam.getName()).isEqualTo("anParameter");

those referenced operation parameters wouldn't be resolved at parsing stage ?

@gracekarina
Copy link
Contributor

closed by #1065 and #1080

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

3 participants