Skip to content
New issue

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

Duplicated title when there's no content under title #1925

Closed
gqcn opened this issue Mar 10, 2022 · 4 comments · Fixed by #2119
Closed

Duplicated title when there's no content under title #1925

gqcn opened this issue Mar 10, 2022 · 4 comments · Fixed by #2119

Comments

@gqcn
Copy link

gqcn commented Mar 10, 2022

Describe the bug
Duplicated title when there's no content under title

Expected behavior
No duplicated title.

Minimal reproducible OpenAPI snippet(if possible)

{
    "openapi": "3.0.0",
    "components": {
        "schemas": {
            "main.HelloReq": {
                "type": "object",
                "required": [
                    "Name"
                ],
                "properties": {
                    "Name": {
                        "type": "string",
                        "format": "string",
                        "description": "Your name",
                        "pattern": "required",
                        "properties": {}
                    }
                }
            },
            "main.HelloRes": {
                "type": "object",
                "properties": {
                    "Reply": {
                        "type": "string",
                        "format": "string",
                        "description": "Reply content",
                        "properties": {}
                    }
                }
            }
        }
    },
    "info": {
        "title": "",
        "description": "# Test",
        "version": ""
    },
    "paths": {
        "/hello": {
            "get": {
                "parameters": [
                    {
                        "name": "Name",
                        "in": "query",
                        "description": "Your name",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "string",
                            "description": "Your name",
                            "pattern": "required",
                            "properties": {}
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/main.HelloRes"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Screenshots
image

Additional context
None.

@alecStewart1
Copy link

I am also experiencing this issue. It's very annoying.

@supernovaniu
Copy link

I got the same issue too. Hope it is fixed soon

@JaakkoHaukipuro
Copy link

For me the titles are duplicated always. No matter if there is content after title.

@shayes-leav
Copy link

I've found this happens when there's a space between the "#" symbol and the header, for example:

"info": {
    "title": "",
    "description": "# Test",
    "version": ""
},

 It can be temporarily fixed by removing the space:
     "info": {
        "title": "",
        "description": "#Test",
        "version": ""
},
 Markdown standard has a space between so this must be some sort of issue with how the markdown is being generated from the json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants