-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug in generic schemas on OpenApi derive macro
This commit fixes bug caused by changes introduced here #1184 by adding necessary changes to how schema is added to an OpenApi when it is added via `components(schemas(...))` attribute of the OpenApi derive macro. Fixes #1265
- Loading branch information
Showing
3 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
utoipa-gen/tests/snapshots/openapi_derive__derive_generic_openapi_compoment_schemas.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
source: utoipa-gen/tests/openapi_derive.rs | ||
expression: schemas | ||
snapshot_kind: text | ||
--- | ||
{ | ||
"schemas": { | ||
"dto.page.Response_dto.get.unit.Response": { | ||
"properties": { | ||
"list": { | ||
"items": { | ||
"$ref": "#/components/schemas/dto.get.unit.Response" | ||
}, | ||
"type": "array" | ||
}, | ||
"num": { | ||
"format": "int64", | ||
"minimum": 0, | ||
"type": "integer" | ||
}, | ||
"size": { | ||
"format": "int64", | ||
"minimum": 0, | ||
"type": "integer" | ||
}, | ||
"total": { | ||
"format": "int64", | ||
"minimum": 0, | ||
"type": "integer" | ||
} | ||
}, | ||
"required": [ | ||
"list", | ||
"num", | ||
"size", | ||
"total" | ||
], | ||
"type": "object" | ||
} | ||
} | ||
} |