Skip to content

After upgrade to 2.6.4 - swagger schema uses jsonld for all media types #4215

Description

@guilliamxavier

API Platform version(s) affected: 2.6.4 (regression from 2.6.3)

Description
(extracted from #4212)
The generated OpenAPI docs use the same schemas for content mime types application/json (and application/html) as for application/ld+json

How to reproduce
Default config, Dummy resource (id, name)

Possible Solution
After #4213, move both occurrences of

            $schema = new Schema('openapi');
            $schema->setDefinitions($schemas);

to inside respectively
foreach ($responseMimeTypes as $operationFormat) { and
foreach ($requestMimeTypes as $operationFormat) {
(just before each call to $this->jsonSchemaFactory->buildSchema(/*...*/))

Additional Context

(the bug is not in Swagger-UI but really in the generated docs.json)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions