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

Dynamite: "parameters" don't support "$ref" in openapi specs #2590

Open
pippijn opened this issue Oct 26, 2024 · 3 comments
Open

Dynamite: "parameters" don't support "$ref" in openapi specs #2590

pippijn opened this issue Oct 26, 2024 · 3 comments
Labels
feature New feature or request package: dynamite

Comments

@pippijn
Copy link

pippijn commented Oct 26, 2024

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Create an something.openapi.json file with an operation using a "parameters" with a reference in it.
  2. dart run build_runner build

Expected behaviour

It should behave the same as if the $ref had been inlined.

Actual behaviour

Deserializing to 'OpenAPI' failed due to: Deserializing to 'BuiltMap<String, PathItem>' failed due to: Deserializing to 'PathItem' failed due to: Deserializing to 'Operation' failed due to: Deserializing to 'BuiltList<Parameter>' failed due to: Deserializing to 'Parameter' failed due to: Null check operator used on a null value
package:built_value/src/built_json_serializers.dart 180:11  BuiltJsonSerializers._deserialize
package:built_value/src/built_json_serializers.dart 125:18  BuiltJsonSerializers.deserialize
package:built_value/src/built_json_serializers.dart 42:12   BuiltJsonSerializers.deserializeWith
package:dynamite/src/builder/state.dart 26:57               State.spec
package:dynamite/src/builder/state.dart                     State.spec
package:dynamite/src/openapi_builder.dart 55:43             OpenAPIBuilder.build
@pippijn pippijn added the bug Something isn't working label Oct 26, 2024
@provokateurin
Copy link
Member

Thanks for reporting, I will look into it soon.
Can you maybe post a minimal spec that produces this error? Then it is a bit easier for me to confirm and fix it.

@pippijn
Copy link
Author

pippijn commented Oct 28, 2024

I haven't tested the not-working one for correctness, but I think it's correct. I'll check in a few hours.

@provokateurin
Copy link
Member

Ah yes, the problem is that we don't resolve and refs that don't point to #/components/schemas/*. I initially thought you meant a $ref inside the schema of a parameter.

@provokateurin provokateurin added feature New feature or request and removed bug Something isn't working labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request package: dynamite
Projects
None yet
Development

No branches or pull requests

2 participants