neon
neon copied to clipboard
Dynamite: `"parameters"` don't support `"$ref"` in openapi specs
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
- Create an something.openapi.json file with an operation using a
"parameters"with a reference in it. -
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
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.
- Not working: broken.openapi.json
- Working (without
$ref): working.openapi.json
I haven't tested the not-working one for correctness, but I think it's correct. I'll check in a few hours.
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.