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

docs: add full schema link #1415

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

TC-MO
Copy link
Contributor

@TC-MO TC-MO commented Jan 17, 2025

Add full schema link to API docs introductory paragraph

@TC-MO TC-MO added documentation Improvements or additions to documentation. adhoc Ad-hoc unplanned task added during the sprint. t-docs Issues owned by technical writing team. labels Jan 17, 2025
@TC-MO TC-MO requested a review from jancurn January 17, 2025 17:12
@TC-MO TC-MO self-assigned this Jan 17, 2025
HTTP endpoints.
HTTP endpoints.

You can check the complete OpenAPI schema [here](https://docs.apify.com/api/apify-api.yaml).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be better to link https://github.com/apify/apify-docs/tree/master/apify-api/openapi instead of this strange page? People can find more in that directory. Also, please let's add JSON version

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the very same content, compiled into one file. I believe this is what anyone would use if they want to work with our schema.

I will add the JSON version tomorrow, again, it will be a single file. We can surely link to the source files if that makes some sense (but I am not sold on that really, who does that, what would be the use case?).

Thoughts @netmilk?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, but still I think it's good to link the GitHub source code from which the actual API docs are generated. We do the same for all our docs pages. And who knows, maybe somebody will send a PR...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The simplest convention in the OpenAPI community is is that the compiled openapi.yaml and openapi.json are in the root of the API URL space, serving as a single source of truth for the API itself. They are idelaly deployed together with the API service implementation and tested against it.

In our case:

https://api.apify.com/v2/openapi.json

If not possible, the proposed URL will do for now, because we don't do "API design first" and the openapi document is dependant on the API implementation, not vice versa. The openapi document will be discoverable through the link in the API Docs for now.

it's good to link the GitHub source code
People won't see the href= base URL unless they "copy as link it" and paste it somewhere. If we want to navigate people to the Docs Github repo to edit the openapi, we need to do a better job communicating the repo in the docs itself. Something along the lines of clickable source maps comes to my mind.

Relevant to this, there are more API discovery options to evaluate:
https://apisjson.org/
OAI/OpenAPI-Specification#1851
OAI/OpenAPI-Specification#724

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the convention, we should ideally do it that way.

But still, let's add those YAML/JSON links to the API docs text (so that you can find it by searching "openapi"), and also let's add that link also to the GitHub directory with the source code.

Let's not overcomplicate this, we're talking about 2 lines of text here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can have a redirect (or rewrite) from api.apify.com, but from the context of apify-docs repo I don't think we can do that.

Btw since you wanted the JSON variant too, I had to patch the plugin, so I could alter the Export label too. Do we really need this if I change the label to Download OpenAPI like this?

image

#1419

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes more sense to me than to have a button & separate link within prose

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw I also changed the URL (as agreed with Adam) to http://docs.apify.com/api/openapi.yaml and http://docs.apify.com/api/openapi.json in that PR, so if we want to keep it in the description, we'll have to adjust that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adhoc Ad-hoc unplanned task added during the sprint. documentation Improvements or additions to documentation. t-docs Issues owned by technical writing team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants