forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[elm] Add support for nested Lists & Dicts (OpenAPITools#1528)
And rename Union Types to Custom Types and Aliases to Records.
- Loading branch information
Showing
20 changed files
with
51 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tor/src/main/resources/elm/union.mustache → ...rc/main/resources/elm/customType.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../main/resources/elm/unionDecoder.mustache → .../resources/elm/customTypeDecoder.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../main/resources/elm/unionEncoder.mustache → .../resources/elm/customTypeEncoder.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
modules/openapi-generator/src/main/resources/elm/fieldDecoder.mustache
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
modules/openapi-generator/src/main/resources/elm/fieldEncoder.mustache
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
modules/openapi-generator/src/main/resources/elm/modelTypeAlias.mustache
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
modules/openapi-generator/src/main/resources/elm/modelTypeCustom.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{>customType}} | ||
|
||
|
||
{{>customTypeDecoder}} | ||
|
||
|
||
{{>customTypeEncoder}} |
26 changes: 26 additions & 0 deletions
26
modules/openapi-generator/src/main/resources/elm/modelTypeRecord.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
type alias {{classname}} = | ||
{ {{#allVars}}{{^-first}} , {{/-first}}{{name}} : {{^required}}{{^isNullable}}Maybe ({{/isNullable}}{{/required}}{{>recordFieldType}}{{^required}}{{^isNullable}}){{/isNullable}}{{/required}} | ||
{{/allVars}} } | ||
{{#vars}} | ||
{{#isEnum}} | ||
|
||
|
||
{{>customType}} | ||
{{/isEnum}} | ||
{{/vars}} | ||
|
||
|
||
{{>recordDecoder}} | ||
|
||
|
||
{{>recordEncoder}} | ||
{{#vars}} | ||
{{#isEnum}} | ||
|
||
|
||
{{>customTypeDecoder}} | ||
|
||
|
||
{{>customTypeEncoder}} | ||
{{/isEnum}} | ||
{{/vars}} |
7 changes: 0 additions & 7 deletions
7
modules/openapi-generator/src/main/resources/elm/modelTypeUnion.mustache
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
modules/openapi-generator/src/main/resources/elm/recordFieldDecoder.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{#required}}required{{/required}}{{^required}}optional{{/required}} "{{baseName}}" {{^required}}{{^isNullable}}(Decode.nullable {{/isNullable}}{{/required}}{{>recordFieldValueDecoder}}{{^required}}{{^isNullable}}) {{{defaultValue}}}{{/isNullable}}{{/required}} |
1 change: 1 addition & 0 deletions
1
modules/openapi-generator/src/main/resources/elm/recordFieldEncoder.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
( "{{baseName}}", {{#discriminatorValue}}Encode.string "{{discriminatorValue}}"{{/discriminatorValue}}{{^discriminatorValue}}{{^required}}{{^isNullable}}Maybe.withDefault Encode.null (Maybe.map {{/isNullable}}{{/required}}{{>recordFieldValueEncoder}} model.{{name}}{{^required}}{{^isNullable}}){{/isNullable}}{{/required}}{{/discriminatorValue}} ) |
1 change: 1 addition & 0 deletions
1
modules/openapi-generator/src/main/resources/elm/recordFieldType.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{#isNullable}}(Maybe {{/isNullable}}{{#isContainer}}({{#isListContainer}}List{{/isListContainer}}{{#isMapContainer}}Dict String{{/isMapContainer}} {{#items}}{{>recordFieldType}}{{/items}}){{/isContainer}}{{^isContainer}}{{#isEnum}}{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{dataType}}{{/isEnum}}{{/isContainer}}{{#isNullable}}){{/isNullable}} |
1 change: 1 addition & 0 deletions
1
modules/openapi-generator/src/main/resources/elm/recordFieldValueDecoder.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{#isNullable}}(Decode.nullable {{/isNullable}}{{#isContainer}}({{#isListContainer}}Decode.list{{/isListContainer}}{{#isMapContainer}}Decode.dict{{/isMapContainer}} {{#items}}{{>recordFieldValueDecoder}}{{/items}}){{/isContainer}}{{^isContainer}}{{vendorExtensions.elmDecoder}}{{/isContainer}}{{#isNullable}}) {{{defaultValue}}}{{/isNullable}} |
1 change: 1 addition & 0 deletions
1
modules/openapi-generator/src/main/resources/elm/recordFieldValueEncoder.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{#isNullable}}Maybe.withDefault Encode.null (Maybe.map {{/isNullable}}{{#isContainer}}({{#isListContainer}}Encode.list{{#isElm018}} << List.map{{/isElm018}}{{/isListContainer}}{{#isMapContainer}}Encode.dict identity{{/isMapContainer}} {{#items}}{{>recordFieldValueEncoder}}{{/items}}{{/isContainer}}{{^isContainer}}{{vendorExtensions.elmEncoder}}{{/isContainer}}{{#isContainer}}){{/isContainer}}{{#isNullable}}){{/isNullable}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.3.2-SNAPSHOT | ||
3.3.4-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.3.2-SNAPSHOT | ||
3.3.4-SNAPSHOT |