- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 879
Open
Labels
Description
Version
4.30.0
Description
After upgrade from 4.13.0 -> 4.30.0 ( its happening after that fix: ddeb3d4 ) when i mark some property as NotNull schema is totally different than before update
#[Serializer\Type('enum<Application\SomeStatus>')]
#[Assert\NotNull]
private SomeStatus $status;
4.13.0 (even 4.28.0 is fine) because of error what i provided above
schema:
"properties": {
                    "status": {
                        "$ref": "#/components/schemas/SomeStatus"
                    }
                },
                "type": "object"
after upgrade to 4.29.0+ (in my case 4.30.0 to be exact)
"properties": {
                    "status": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/SomeStatus"
                            }
                        ]
                    }
                },
                "type": "object"
After adding line: unset($customFields['nullable']); to JMSModelDescriber problem was gone and schema was same as it was before update of package
            $customFields = (array) $property->jsonSerialize();
            unset($customFields['property']);
            if ([] === $customFields) { // no custom fields
                $property->ref = $modelRef;
            } else {
                $weakContext = Util::createWeakContext($property->_context);
                $property->oneOf = [new OA\Schema(['ref' => $modelRef, '_context' => $weakContext])];
            }
 
JSON OpenApi
JSON OpenApi
Replace this text with your JSON (`bin/console nelmio:apidoc:dump`)
Additional context
No response