-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[elm] failed to generate map from object with additionalProperties #1140
Comments
@mxinden thanks for reporting the issue. cc @trenneman |
Thanks for the work on this @trenneman @wing328! I have tested out the latest docker image and current master (196f122). The generated file now properly imports {-
Alertmanager API
API of the Prometheus Alertmanager (https://github.com/prometheus/alertmanager)
OpenAPI spec version: 0.0.1
NOTE: This file is auto generated by the openapi-generator.
https://github.com/openapitools/openapi-generator.git
Do not edit this file manually.
-}
module Data.LabelSet exposing (LabelSet, decoder, encoder)
import Dict exposing (Dict)
import Json.Decode as Decode exposing (Decoder)
import Json.Decode.Pipeline exposing (optional, required)
import Json.Encode as Encode
type alias LabelSet =
{ }
decoder : Decoder LabelSet
decoder =
Decode.succeed LabelSet
encoder : LabelSet -> Encode.Value
encoder model =
Encode.object
] Am I running off of the wrong version? |
@mxinden you can use
|
@trenneman @wing328 ah, sorry, I have overlooked the inline I am simply deleting |
Description
I am trying to generate an elm client based on an OpenAPI spec (see below). The spec contains a map (
labelSet
) represented as an object with theadditionalProperties
field and noproperties
field like described in the swagger docs.Generating the client with the command mentioned below generates an invalid
LabelSet.elm
file.openapi-generator version
Image ID:
acde33bd7281
OpenAPI declaration file content or url
Invalid output file
LabelSet.elm
:Command line used for generation
docker run --user=1000:1000 --rm -v /home/mxinden/go/src/github.com/prometheus/alertmanager/ui/app/../..:/local openapitools/openapi-generator-cli:latest generate \ -i /local/api/v2/openapi.yaml\ -g elm \ --version \ -o /local/ui/app/./openapi-STca4PUI5T
Steps to reproduce
Running
elm format
on the aboveLabelSet.elm
file results in:The text was updated successfully, but these errors were encountered: