We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Platform version(s) affected: 4.0.12
Description
in custom custom decorated api_platform.metadata.property.metadata_factory I return following property schema (schema_type = input):
api_platform.metadata.property.metadata_factory
schema_type = input
'exclusiveMinimum' => 0, 'type' => [ 'integer', 'null', ],
in a result on this line https://github.com/api-platform/core/blob/4.1/src/JsonSchema/SchemaFactory.php#L189 I have following variable values:
$isUnknown = false; $propertySchema = [ 'exclusiveMinimum' => 0, 'type' => [ 'integer', 'null', ], ]; $propertySchemaType = [ 'integer', 'null', ];
but since this condition is not passed:
if ( !$isUnknown && ( [] === $types || ($propertySchema['$ref'] ?? $propertySchema['anyOf'] ?? $propertySchema['allOf'] ?? $propertySchema['oneOf'] ?? false) || (\is_array($propertySchemaType) ? \array_key_exists('string', $propertySchemaType) : 'string' !== $propertySchemaType) || ($propertySchema['format'] ?? $propertySchema['enum'] ?? false) ) ) { $schema->getDefinitions()[$definitionName]['properties'][$normalizedPropertyName] = new \ArrayObject($propertySchema); return; }
my schema is changed to:
$propertySchema = [ 'exclusiveMinimum' => 0, 'anyOf' => [ [ '$ref' => '#/components/schemas/Entity.jsonld-Input', ], [ 'type' => 'null', ], ], ];
which is not I want.
How to reproduce
Possible Solution
not sure about this condition, why generated schema is changed at all: https://github.com/api-platform/core/blob/4.1/src/JsonSchema/SchemaFactory.php#L189 but this check looks suspicious:
\is_array($propertySchemaType) ? \array_key_exists('string', $propertySchemaType) : 'string' !== $propertySchemaType
especially when type in openapi schema should be string or plain array of strings. https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-6.1.1
type
Additional Context
The text was updated successfully, but these errors were encountered:
No branches or pull requests
API Platform version(s) affected: 4.0.12
Description
in custom custom decorated
api_platform.metadata.property.metadata_factory
I return following property schema (schema_type = input
):in a result on this line https://github.com/api-platform/core/blob/4.1/src/JsonSchema/SchemaFactory.php#L189 I have following variable values:
but since this condition is not passed:
my schema is changed to:
which is not I want.
How to reproduce
Possible Solution
not sure about this condition, why generated schema is changed at all: https://github.com/api-platform/core/blob/4.1/src/JsonSchema/SchemaFactory.php#L189
but this check looks suspicious:
especially when
type
in openapi schema should be string or plain array of strings.https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-6.1.1
Additional Context
The text was updated successfully, but these errors were encountered: