apib2swagger icon indicating copy to clipboard operation
apib2swagger copied to clipboard

Content-Type application/scim+json isn't creating a corresponding "consumes" section

Open scarpent opened this issue 2 years ago • 2 comments

I'm using v1.16.1, and have some apib like this:

### Create a user [POST /api/scim/v2/Users]

+ Request
    + Headers

            Content-Type: application/scim+json
            Authorization: Bearer token

    + Body

            {
                "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
                "userName": "fredsmith",
                "name": {
                    "givenName": "Fred",
                    "familyName": "Smith"
                },
                "emails": [
                    {"primary": true, "value": "[email protected]", "type": "work"}
                ],
                "displayName": "Fred Smith",
                "externalId": "fred-external-id",
                "active": true
            }

+ Response 201 (application/scim+json)

    + Attributes (ExistingUser)

When producing the swagger json, it creates a produces section, but not consumes, which then causes a UI viewer to default (I'm assuming) to application/json for "content type" and "request body schema". If I add the consumes section myself, it displays correctly.

"produces": [
    "application/scim+json"
],
"consumes": [
    "application/scim+json"
],

Thank you!

scarpent avatar Oct 10 '23 20:10 scarpent

I have released v1.17.0 to support consumes for swagger 2.0. Please confirm it, thank you!

kminami avatar Oct 21 '23 08:10 kminami

Works perfectly. 🚀 Thank you so much! 🙏

scarpent avatar Oct 24 '23 14:10 scarpent