asyncapi / bindings

AsyncAPI bindings specifications
Apache License 2.0
73 stars 74 forks source link

[FEATURE REQUEST] Support Parameter formats #8

Open fmvilas opened 5 years ago

fmvilas commented 5 years ago

@raveclassic commented on Fri Nov 15 2019

Is your feature request related to a problem? Please describe. Currently ws channel bindings allow you to define some query/header parameters: https://github.com/asyncapi/bindings/tree/master/websockets#channel-binding-object However this solution lacks flexibility and power in comparison to swagger-2 or openapi-3 parameters. Especially in case of non-primitive parameters - there's no way to define how such parameters should be serialized. Swagger-2 spec has a collectionFormat and openapi-3 - style/explode for that.

Can't it be tackled using specification extensions? IMO this should be part of the core spec.

Describe the solution you'd like The best would be to replicate openapi-3 approach to describe parameters using in/style/explode (etc.) properties.

Describe alternatives you've considered Not sure there're some which would allow the same level of flexibility and consistency.

Additional context I'm writing a codegen tool based on swagger-2/openapi-3/asyncapi-2 specs which automatically handles connections that's why I need a solution to fully handle parameters.

fmvilas commented 5 years ago

I like the idea of unifying query parameters and headers into a parameters array following the OpenAPI 3 style. However, I would keep this in the WS binding (and maybe HTTP too) for now given that these features only exist in WS and HTTP. There are no other messaging protocols that support query parameters, cookies, etc.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart: