| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package: v2 | ||
| generate: | ||
| models: true | ||
| embedded-spec: true | ||
| output-options: | ||
| skip-prune: true | ||
| output: embed/openapi.gen.go |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| openapi: "3.0.1" | ||
| info: | ||
| version: 1.0.0 | ||
| title: Tests AllOf composition | ||
| paths: {} | ||
| components: | ||
| schemas: | ||
| PersonProperties: | ||
| type: object | ||
| description: | | ||
| These are fields that specify a person. They are all optional, and | ||
| would be used by an `Edit` style API endpoint, where each is optional. | ||
| properties: | ||
| FirstName: | ||
| type: string | ||
| LastName: | ||
| type: string | ||
| GovernmentIDNumber: | ||
| type: integer | ||
| format: int64 | ||
| FirstName: | ||
| type: object | ||
| properties: | ||
| FirstName: | ||
| type: string | ||
| Person: | ||
| type: object | ||
| x-go-allof-embed-refs: true | ||
| description: | | ||
| This is a person, with mandatory first and last name, but optional ID | ||
| number. This would be returned by a `Get` style API. We merge the person | ||
| properties with another Schema which only provides required fields. | ||
| allOf: | ||
| - $ref: "#/components/schemas/PersonProperties" | ||
| - required: [ FirstName, LastName ] | ||
| - $ref: "#/components/schemas/FirstName" | ||
| PersonAllOfSingle: | ||
| type: object | ||
| x-go-allof-embed-refs: true | ||
| description: | | ||
| This is a person record as returned from a Create endpoint. It contains | ||
| all the fields of a Person, with an additional resource UUID. | ||
| allOf: | ||
| - $ref: "#/components/schemas/Person" | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityPotential overlapping field issue: both PersonProperties (line 34) and FirstName (line 36) define a FirstName property. The validation logic in merge_schemas.go:215-219 checks for overlapping fields and should reject this when x-go-allof-embed-refs: true is set. Verify that this test case generates correctly or if it needs to be updated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.