[BUG] 5.0.0 beta3 (regression from beta2) produces invalid Elm code with doubled decoders/types for JSON arrays
See original GitHub issueJson arrays are turned into invalid decoders/functions in beta3, where the record access of the decoder or type is doubled, producing invalid Elm code.
For example, everywhere that should have
Json.Decode.list Api.Data.widgetDecoder
instead has
Json.Decode.list Api.Data.widgetDecoder.Api.Data.widgetDecoder
This additionally occurs in the type annotations, e.g. what should be
findWidgets : List String -> Api.Requrest (List Api.Data.Widget)
will instead be
findWidgets : List String -> Api.Requrest (List Api.Data.Widget.Api.Data.Widget)
An example with the petstore is produced below (but this problem occurs in other APIs as well that I have tried).
To produce:
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.0.0-beta2/openapi-generator-cli-5.0.0-beta2.jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.0.0-beta3/openapi-generator-cli-5.0.0-beta3.jar
java -jar openapi-generator-cli-5.0.0-beta2.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g elm -o petstore-beta2
java -jar openapi-generator-cli-5.0.0-beta3.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g elm -o petstore-beta3
diff -r petstore-beta2 petstore-beta3
Diff output:
diff -r petstore-beta2/.openapi-generator/VERSION petstore-beta3/.openapi-generator/VERSION
1c1
< 5.0.0-beta2
\ No newline at end of file
---
> 5.0.0-beta3
\ No newline at end of file
diff -r petstore-beta2/src/Api/Request/Pet.elm petstore-beta3/src/Api/Request/Pet.elm
93c93
< findPetsByStatus : List Status -> Api.Request (List Api.Data.Pet)
---
> findPetsByStatus : List Status -> Api.Request (List Api.Data.Api.Data.Pet)
102c102
< (Json.Decode.list Api.Data.petDecoder)
---
> (Json.Decode.list Api.Data.petDecoderApi.Data.petDecoder)
108c108
< findPetsByTags : List String -> Api.Request (List Api.Data.Pet)
---
> findPetsByTags : List String -> Api.Request (List Api.Data.Api.Data.Pet)
117c117
< (Json.Decode.list Api.Data.petDecoder)
---
> (Json.Decode.list Api.Data.petDecoderApi.Data.petDecoder)
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
What if the Regression Equation Contains "Wrong" Predictors?
The good thing is that a correctly specified regression model yields unbiased regression coefficients and unbiased predictions of the response.
Read more >Incorrect output is returned when you use the Linear ...
Discusses a problem in which the incorrect output is returned when you use Linear Regression (LINEST) function in Excel.
Read more >Multiple Linear Regression
Multiple Regression Analysis. The regression coefficient β1 is interpreted as the expected change in Y associated with a 1-unit increase in x1.
Read more >Practical Regression and Anova using R
The emphasis of this text is on the practice of regression and analysis of variance. The objective is to learn what methods are...
Read more >Linear Regression Tool | Alteryx Help
The Linear Regression Tool creates a simple model to estimate values, or evaluate relationships between variables based on a linear ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve file https://github.com/OpenAPITools/openapi-generator/pull/8223 to fix it. Can you please take a look as well?
@SiriusStarr I’ve merged #8223. Please open a new issue instead. Thank you.