Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

additionalProperties wrong map type #30

Open
auzhva opened this issue Oct 17, 2020 · 0 comments
Open

additionalProperties wrong map type #30

auzhva opened this issue Oct 17, 2020 · 0 comments

Comments

@auzhva
Copy link

auzhva commented Oct 17, 2020

Hi,

In Swagger model I have following construct:

someAttributes:
        type: object
        description: someAttributes
        additionalProperties:
          type: string

Then I'm trying to build this model with gnostic-go-generator it produces below model

{
      "name": "someAttributes",
      "fields": [
        {
          "name": "additional_properties",
          "type": "map[string]string",
          "kind": 1,
          "native_type": "Map[String]String",
          "field_name": "AdditionalProperties",
          "parameter_name": "additional_properties"
        }
      ],
      "type_name": "SomeAttributes"
    },

Type Map[String]String is invalid in Go, so it results in broken types.go file

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant