Skip to content

After upgrade to 2.6.4 - swagger "Request body schema" uses defined "output dto" #4212

Description

@tecbird

API Platform version(s) affected: 2.6.4
Description
Request schema is replaced with response model (dto)
And response shows also JsonLd attributes (on plain json, xml)

How to reproduce
Create an "POST" endpoint with output dto

Possible Solution
Downgrade to 2.6.3

Additional Context
Swagger output (Request and Response uses same dto - makes no sense)
image

Endpoint yaml:

resources:
App\DTOs\Erp\Import\Article\Availability\Articles:
shortName: 'Availability'
description: 'Import availability (stocks)'
attributes:
security: 'is_granted("IP_ACCESS")'
security_message: 'Sorry, access forbidden'
route_prefix: '/erp'
formats:
xml: [ 'application/xml', 'text/xml' ] # xml first - so it's default!
json: [ 'application/json' ]
jsonld: [ 'application/ld+json' ]
denormalization_context:
groups: [ 'write' ]
normalization_context:
groups: [ 'read' ]
collectionOperations:
post:
path: '/import/availability/stock'
status: 201
output: App\DTOs\Erp\Generic\ResponseDto
validation_groups:
- 'Default'
- 'write'
itemOperations: [ ]

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