File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -397,4 +397,17 @@ public function parameterSchemaInferredType(
397397 $ inferredParam
398398 ): void {
399399 }
400+
401+ /**
402+ * Parameter with complete custom definition via #[Schema(definition: ...)]
403+ */
404+ public function parameterWithRawDefinition (
405+ #[Schema(definition: [
406+ 'description ' => 'Custom-defined schema ' ,
407+ 'type ' => 'string ' ,
408+ 'format ' => 'uuid '
409+ ])]
410+ string $ custom
411+ ): void {
412+ }
400413}
Original file line number Diff line number Diff line change 354354
355355 expect ($ schema ['required ' ])->toEqual (['inferredParam ' ]);
356356});
357+
358+ it ('uses raw parameter-level schema definition as-is ' , function () {
359+ $ method = new ReflectionMethod (SchemaGeneratorFixture::class, 'parameterWithRawDefinition ' );
360+ $ schema = $ this ->schemaGenerator ->generate ($ method );
361+
362+ expect ($ schema ['properties ' ]['custom ' ])->toEqual ([
363+ 'description ' => 'Custom-defined schema ' ,
364+ 'type ' => 'string ' ,
365+ 'format ' => 'uuid '
366+ ]);
367+
368+ expect ($ schema ['required ' ])->toEqual (['custom ' ]);
369+ });
You can’t perform that action at this time.
0 commit comments