Skip to content
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

♻️ CodeGen - CSharp - generate additional properties as a deepObject #4948

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MattParkerDev
Copy link

Currently, additionalProperties are generated like a dictionary, regardless of the "style" = "deepObject"

example parameter from openapi spec

{
  "name": "attributes",
  "in": "query",
  "required": false,
  "explode": true,
  "style": "deepObject",
  "schema": {
    "minProperties": 1,
    "type": "object",
    "properties": {
      "name": {
        "type": "string"
      }
    },
    "additionalProperties": {
      "type": "string"
    }
  }
}

Currently, named properties such as name in the example json, generate correctly in the C# code, however un-named additional properties do not, and should.

as per https://swagger.io/docs/specification/serialization/
image
image

@MattParkerDev
Copy link
Author

@RicoSuter is this something that can be merged? :)

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

Successfully merging this pull request may close these issues.

1 participant