Skip to content

[Enhancement] added support for custom type & format mapping#4931

Closed
ShoeBoom wants to merge 1 commit intoOpenAPITools:masterfrom
ShoeBoom:master
Closed

[Enhancement] added support for custom type & format mapping#4931
ShoeBoom wants to merge 1 commit intoOpenAPITools:masterfrom
ShoeBoom:master

Conversation

@ShoeBoom
Copy link
Copy Markdown

@ShoeBoom ShoeBoom commented Jan 6, 2020

Description of the PR

Makes it possible to map format.

For example these args can be used to properly map the following:

"foo": {
    "enum": [
        "0",
        "1",
        "2"
    ],
    "type": "integer",
    "format": "byte"
}

generate -i openapi.json -o out -g kotlin --type-mappings integer_byte=kotlin.Byte

By default it would map foo to Int

this is similar to #2730

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@auto-labeler
Copy link
Copy Markdown

auto-labeler Bot commented Jan 6, 2020

👍 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.

@ShoeBoom ShoeBoom changed the title added support for custom type & format mapping [Enhancement] added support for custom type & format mapping Jan 6, 2020
Copy link
Copy Markdown
Member

@jimschubert jimschubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this idea. Just had a suggestion/discussion piece on the chosen format.

@runkelstein
Copy link
Copy Markdown

Absolutely, we need this feature. This is almost a blocker for using OpenApi.

I personally need it for a mapping of Yoda Money and BigMoney Types. Please find a solution.

Custom Type Mapping via mapping.yml would be amazing

@wing328
Copy link
Copy Markdown
Member

wing328 commented Apr 17, 2021

Closed via #9285

@wing328 wing328 closed this Apr 17, 2021
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.

4 participants