Redocly / redoc

📘 OpenAPI/Swagger-generated API Reference Documentation
https://redocly.github.io/redoc/
MIT License
23.39k stars 2.29k forks source link

Reference title is displayed in output #878

Open ZQ-PSK opened 5 years ago

ZQ-PSK commented 5 years ago

Here's my piece of spec:

"AuthenticatewithFacebookRequest": {
                "required": [
                    "facebookToken",
                    "apiKey",
                    "uuid"
                ],
                "type": "object",
                >>some irrelevant params here<<
                "properties": {
                    "agreements": {
                        "$ref": "#/components/schemas/Agreements"
                    },
                    "attributes": {
                        "$ref": "#/components/schemas/Attributes"
                    },
                    "tags": {
                        "$ref": "#/components/schemas/Tags"
                    }

Here's the "Agreements" schema:

            "Agreements": {
                "description": "Marketing agreements of the Client",
                "required": [
                    "email",
                    "sms",
                    "push",
                    "bluetooth",
                    "rfid",
                    "wifi"
                ],
                "type": "object",
                "properties": {
                    "email": {
                        "type": "boolean",
                        "description": "Permission to receive marketing information by e-mail"
                    },
                    "sms": {
                        "type": "boolean",
                        "description": "Permission to receive marketing information by SMS"
                    },
                    "push": {
                        "type": "boolean",
                        "description": "Permission to receive push notifications"
                    },
                    "bluetooth": {
                        "type": "boolean"
                    },
                    "rfid": {
                        "type": "boolean"
                    },
                    "wifi": {
                        "type": "boolean"
                    }

The output is in the attached image and my problem is marked with arrows. Can I stop ReDoc from attaching the name of the referenced schema? I can use a reference resolver (swagger-combine in my case, with just one file to combine with nothing) before feeding my spec to ReDoc, but could I avoid this additional step?

Screenshot 2019-04-02 at 09 02 35
RomanHotsiy commented 5 years ago

It can be possible by adding a config option to ReDoc.

PR is welcomed!