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

[BUG] Custom :getter option for parameter results in invalid schema. #747

Open
1 of 3 tasks
james-reading opened this issue Apr 30, 2024 · 0 comments
Open
1 of 3 tasks

Comments

@james-reading
Copy link

Describe the bug

Using the custom :getter option for parameters as described here, will introduce a getter key in the generated schema, and make the schema invalid.

In the spec :

parameter name: "labSlug", getter: :lab_slug, in: :path

In the generator schema, this results in:

"parameters": [
  {
    "name": "labSlug",
    "getter": "lab_slug",
    "in": "path",
    ...

Then when trying to use orval to generate a client from the schema:

🍻 Start orval v6.27.1 - A swagger client generator for typescript
⚠️  SyntaxError: Swagger schema validation failed.
  #/paths/~[...]~1{labSlug}/parameters/0 must NOT have additional properties

Expected behavior

I would expect the getter option to allow me to specific a differen variable for the path parameter. But when generating the schema with rails rswag, I do not expect this to be reflected in the generated schema file.

Dependency versions

The version of are you using for:

  • Rswag: 2.13.0
  • RSpec: 3.13.0
  • Rails: 7.1.3.2
  • Ruby: 3.3.0

Relates to which version of OAS (OpenAPI Specification)

  • OAS2
  • OAS3
  • OAS3.1
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