Skip to content

[haskell-http-client] add support for import-mappings #2381

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

Merged
merged 1 commit into from
Mar 13, 2019

Conversation

jonschoning
Copy link
Contributor

@jonschoning jonschoning commented Mar 13, 2019

import mappings take the form of:

--import-mappings %DATATYPE%=%MODULE%

full example (with --type-mappings):

--type-mappings intstr.IntOrString=IntOrString
--import-mappings IntOrString=Kubernetes.CustomTypes

The import-mapped module will be an exposed module of the generated library.

The import mappings will be re-exported from ImportMappings, which itself is re-xported from Models.

Model.hs

module Kubernetes.Model (module Kubernetes.Model, module Kubernetes.ImportMappings) where
import Kubernetes.ImportMappings

ImportMappings.hs:

module Kubernetes.ImportMappings (module ImportMappings) where
import Kubernetes.CustomTypes as ImportMappings (IntOrString(..))

@auto-labeler
Copy link

auto-labeler bot commented Mar 13, 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 Author

cc @guoshimin

@jonschoning
Copy link
Contributor Author

jonschoning commented Mar 13, 2019

ref issue #2362

@jonschoning jonschoning merged commit 33786e1 into OpenAPITools:master Mar 13, 2019
@jonschoning jonschoning deleted the haskell-http-client branch March 13, 2019 23:32
@guoshimin
Copy link
Contributor

We also need to have a module in the test directory to define the Arbitrary instances for the custom types.

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

Successfully merging this pull request may close these issues.

3 participants