-
-
Notifications
You must be signed in to change notification settings - Fork 940
Closed
Description
API Platform version(s) affected: 4.2.2
Description
Since 4.2.2, my openapi specs changed due to this fix: #6394
There a two issues:
- the definition name is now postfixed by
.jsonMergePathand OpenApi Generator generates new object names. I have to refactor many objects. - all my PATCH input definition lost the required properties.
About the required properties, I have PATCH operations on an entity with a different input that has required fields.
Due to this new condition, I understand I won't be able to have a required field in my schema anymore?
How can I get them back?
Should this be a PUT? I'm not sure which is the best here.
How to reproduce
#[ApiResource(
operations: [
new Patch(
uriTemplate: '/my-entities/{uuid}/custom-action',
input: CustomInput::class,
processor: CustomInputProcessor::class,
),
]
)]
#[ORM\Entity]
class MyEntity
{}
class CustomInput
{
#[Assert\NotBlank]
public ?string $myProperty = null;
}Before:
{
"CustomInput": {
"type": "object",
"required": [
"my_property",
],
"properties": {
"my_propery": {
"type": [
"string",
"null"
]
},
}
}
}After:
{
"CustomInput.jsonMergePath": {
"type": "object",
"properties": {
"my_propery": {
"type": [
"string",
"null"
]
},
}
}
}Possible Solution
Additional Context
cpetit-sigma-fr
Metadata
Metadata
Assignees
Labels
No labels