Skip to content

Convert to Dict #279

@myrho

Description

@myrho

Describe the bug
{"type": "object", "additionalProperties": ...} is not converted to elm Dict type

To Reproduce
Given this openapi spec:

  "components": {
    "schemas": {
      "thing": {
        "required": [
          "dict"
        ],
        "type": "object",
        "properties": {
          "dict": {
            "type": "object",
            "additionalProperties": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "integer",
                    "title": "Value"
                  }
                }
            }
          }
        },
        "title": "Thing"
      }
    }
  },
  "openapi": "3.1.0",
  "servers": [
  ],
  "info": {
    "title": "API",
    "version": "1.0.0",
    "description": ""
    }
}

the generator produces:

type alias Thing =
    { dict : {} }

Expected output is:

type alias Thing =
    { dict : Dict String { value : Int } }

See: https://swagger.io/docs/specification/v3_0/data-models/dictionaries/?sbsearch=additionalproperties

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions