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

Broken markdown link referencing "media type range" #2796

Closed
saibotsivad opened this issue Nov 18, 2021 · 9 comments
Closed

Broken markdown link referencing "media type range" #2796

saibotsivad opened this issue Nov 18, 2021 · 9 comments
Assignees

Comments

@saibotsivad
Copy link
Contributor

On the OpenAPI specs page for Request Body Object what is loaded in my browser looks like this (note the highlighted text):

image

I believe that comes from /versions/3.1.0.md but the Markdown looks correct to me:

The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it.

I tried copy+pasting the surrounding section over to the markdown-it online demo to see if maybe the table syntax was buggy, but it renders correctly there.

Is there a possibility that the published version (at spec.openapis.org/oas/latest.html) is not actually generated from the latest markdown file?

I'm not sure what else to do to be helpful, sorry!

@webron
Copy link
Member

webron commented Nov 19, 2021

Thanks for bringing this up. My guess is that this is a rendering issue related to anchored URL. We'll need to take a look at the generation process in order to solve it.

@saibotsivad
Copy link
Contributor Author

Yeah, that must be it. I thought it was only that one place, but now I see it all over the docs, e.g. in the Operation Object requestBody text:

image

which has this markdown text:

... (such as [GET](https://tools.ietf.org/html/rfc7231#section-4.3.1), ...

@saibotsivad
Copy link
Contributor Author

I believe the problem is to do with this regex-cleanup stuff here: https://github.com/OAI/OpenAPI-Specification/blob/main/scripts/md2html/md2html.js#L262

@webron is this something you'd appreciate a pull request for? If so, from/into what branch?

@webron
Copy link
Member

webron commented Nov 19, 2021

We always welcome PRs, and in this case against main. Not sure how to test it though, but will be happy to give it a shot.

@karenetheridge
Copy link
Member

karenetheridge commented Nov 19, 2021

I also see something similar on the github site at https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#fixed-fields - in "webhooks", the text is Map[string, Path Item Object | Reference Object] ]. (and it's on the published site too, at https://spec.openapis.org/oas/v3.1.0#fixed-fields)

@saibotsivad
Copy link
Contributor Author

@karenetheridge that looks unrelated, the actual markdown has the extra trailing ]:

<a name="oasWebhooks"></a>webhooks | Map[`string`, [Path Item Object](#pathItemObject) \| [Reference Object](#referenceObject)] ] | The incoming webhooks...

@saibotsivad
Copy link
Contributor Author

I created pull request #2798 to main with the fix, and a description of the problem+solution.

@karenetheridge
Copy link
Member

I created #2831 for the unrelated markdown error in the webhooks section.

@MikeRalphson
Copy link
Member

Closing as the cause was fixed in #2798 - thanks all!

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

No branches or pull requests

4 participants