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

Infer runtime producers/consumers from spec #33

Open
GlenDC opened this issue Jan 18, 2017 · 3 comments
Open

Infer runtime producers/consumers from spec #33

GlenDC opened this issue Jan 18, 2017 · 3 comments

Comments

@GlenDC
Copy link
Member

GlenDC commented Jan 18, 2017

Currently runtime's producers/consumers are statically set via a predefined list. While those defaults might not be bad, this could probably be done smarter, by inferring the information from the OpenAPI/Swagger2.0 Spec.

Relevant TODO: https://github.com/go-openapi/runtime/blob/master/client/runtime.go#L136

@mikkeloscar
Copy link

by inferring the information from the OpenAPI/Swagger2.0 Spec.

I think this means using the values from runtime.ClientOperation which most likely comes from a client generated by go-swagger, e.g. comes from the swagger spec.

I will try to find some time in the weekend to work on this unless someone picks it up before.

@GlenDC
Copy link
Member Author

GlenDC commented Jan 19, 2017

Go for it @mikkeloscar

Were you in the meanwhile able to have a working version for now, using my steps listed in issue #31?

@mikkeloscar
Copy link

@GlenDC sorry, I never really got around to this. I realized that it's not that trivial, as you were also suggesting, because you need to implement a consumer/producer for the particular mime type.

For my use case it was the right thing to just use the json consumer like you suggested in #31.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants