File tree Expand file tree Collapse file tree 2 files changed +372
-366
lines changed
crates/handlers/src/admin Expand file tree Collapse file tree 2 files changed +372
-366
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ use mas_router::{
2929 UrlBuilder ,
3030} ;
3131use mas_templates:: { ApiDocContext , Templates } ;
32- use schemars:: transform:: { AddNullable , RecursiveTransform } ;
32+ use schemars:: transform:: AddNullable ;
3333use tower_http:: cors:: { Any , CorsLayer } ;
3434
3535mod call_context;
@@ -173,8 +173,14 @@ where
173173
174174 aide:: generate:: in_context ( |ctx| {
175175 ctx. schema = schemars:: generate:: SchemaGenerator :: new (
176- schemars:: generate:: SchemaSettings :: openapi3 ( )
177- . with_transform ( RecursiveTransform ( AddNullable :: default ( ) ) ) ,
176+ schemars:: generate:: SchemaSettings :: openapi3 ( ) . with ( |settings| {
177+ // Remove the transform which adds nullable fields, as it's not
178+ // valid with OpenAPI 3.1. For some reason, aide/schemars output
179+ // an OpenAPI 3.1 schema with this nullable transform.
180+ settings
181+ . transforms
182+ . retain ( |transform| !transform. is :: < AddNullable > ( ) ) ;
183+ } ) ,
178184 ) ;
179185 } ) ;
180186
You can’t perform that action at this time.
0 commit comments