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

openapi3gen Support Named Embedded Structs #426

Closed
austince opened this issue Sep 23, 2021 · 1 comment · Fixed by #434
Closed

openapi3gen Support Named Embedded Structs #426

austince opened this issue Sep 23, 2021 · 1 comment · Fixed by #434

Comments

@austince
Copy link

Feature request to respect the json:"name" struct tag on embedded structs. Currently, they are always bubbled up to the parent struct.

type EmbeddedStruct struct {
  ID string
}

type ContainerStruct struct {
  Name string
  EmbeddedStruct `json:"Embedded"`
}

Produces:

{
  "properties": {
    "Name": {
	  "type": "string"
	},
	"ID": {
	  "type": "string"
	}
  },
  "type": "object"
}

Expected:

{
  "properties": {
      "Name": {
        "type": "string"
      },
      "Embedded": {
        "properties": {	
          "ID": {
          "type": "string"
          }
        },
      "type": "object"
      }
    },
  "type": "object"
}
@fenollp
Copy link
Collaborator

fenollp commented Oct 2, 2021

PRs open.

@fenollp fenollp linked a pull request Oct 7, 2021 that will close this issue
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 a pull request may close this issue.

2 participants