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

[REQ][haskell-http-client] Support type-mapping and import-mappings #2362

Closed
guoshimin opened this issue Mar 11, 2019 · 4 comments
Closed

[REQ][haskell-http-client] Support type-mapping and import-mappings #2362

guoshimin opened this issue Mar 11, 2019 · 4 comments

Comments

@guoshimin
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Support type-mapping and import-mappings so we can provide custom implementation for selected model, for example, as is done in https://github.com/kubernetes-client/gen/blob/master/openapi/java.xml.

Describe alternatives you've considered

Additional context

In the OpenAPI spec for Kubernetes, there is an IntOrString type that's currently mapped to object if there is no custom mapping for it: https://github.com/kubernetes-client/gen/blob/c07ee54dcb0ae70c6ef587dded93b6ea75f354ea/openapi/preprocess_spec.py#L275. It would be more type safe to create (by hand) a Sum type for it.

@jonschoning

@auto-labeler
Copy link

auto-labeler bot commented Mar 11, 2019

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

@jonschoning
Copy link
Contributor

jonschoning commented Mar 12, 2019

type-mappings:

import-mappings:

  • i will look into adding support

@jonschoning
Copy link
Contributor

modify preprocessor to remove models:
jonschoning/kubernetes-client-gen@b876d77

regen with import-mappings and type-mappings:
jonschoning/kubernetes-client-haskell@063587b

add CustomTypes and CustomInstances:
jonschoning/kubernetes-client-haskell@a268948

tests passed:
https://gist.github.com/jonschoning/df46961e0c999902eec07a3f7785822e

@guoshimin
Copy link
Contributor Author

Thanks for the quick fix! I also did the same test and it worked.

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

2 participants