Skip to content

Add @plone/client tab to sample HTTP examples - #2064

Open
Hrittik20 wants to merge 3 commits into
plone:mainfrom
Hrittik20:docs/plone-client-httpexample
Open

Hrittik20 wants to merge 3 commits into
plone:mainfrom
Hrittik20:docs/plone-client-httpexample

Conversation

@Hrittik20

Copy link
Copy Markdown
Contributor

Summary

  • Adds a custom sphinxcontrib-httpexample builder for @plone/client
  • Enables the new tab on a small sample: aliases (mappable examples) + content GET/POST/PATCH/DELETE
  • Leaves examples without a client equivalent unchanged (aliases filter, CSV import/export, Prefer-header PATCH)

Closes #2063

Notes for reviewers

  • Generated examples use the current @plone/client API with await (not TanStack hook names)
  • Root deleteAliases uses path: '' so the client calls /@aliases
  • A follow-up in plone/documentation will be needed later so the tab also renders on 6.docs.plone.org after the submodule bump

cc @stevepiercy @sneridagh @pnicolli

Test plan

  • Local Sphinx HTML build succeeds
  • Aliases page shows @plone/client on the 6 mappable examples
  • Content page shows @plone/client on POST/GET/PATCH/DELETE
  • Existing curl/httpie/python-requests tabs still render
  • Reviewers check RTD preview / screenshots below

Screenshots

@mister-roboto

Copy link
Copy Markdown

@Hrittik20 thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@read-the-docs-community

read-the-docs-community Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 plone.restapi | 🛠️ Build #35087189 | 📁 Comparing 3b55fbe against latest (2b84de9)

  🔍 Preview build  

2 files changed
± endpoints/aliases.html
± usage/content.html

@stevepiercy stevepiercy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Bump one requirement (I maintain it).

Comment thread requirements-docs.txt Outdated
@stevepiercy

Copy link
Copy Markdown
Member

Docs look great!

Let's make sure that the content for the request and response is correct. @plone/volto-team @plone/volto-developers @plone/aurora-developers would y'all please take a look and provide feedback? Thank you!

Co-authored-by: Steve Piercy <web@stevepiercy.com>

@davisagli davisagli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The elegance of sphinxcontrib-httpexamples was that the example calls could be automatically generated from the actual HTTP messages. So it's unfortunate that this requires adding code in plone_client.py to match each request and generate the right @plone/client call. I realize that's necessary because the function names in @plone/client can't be automatically derived from the requests. However, I'm wondering: would it be possible to pass additional parameters to the http:example directive containing the information needed to write the @plone/client example? It would be easier to maintain if the information for an example is kept in one place rather than 2. (Well okay, it's already in multiple places, because we refer to separate files for the request and response. But I wonder if we can avoid adding another one. If not, I can live with it.)

@Hrittik20

Copy link
Copy Markdown
Contributor Author

@davisagli That makes sense.

I looked into whether we could pass that info through the http:example directive. Right now the custom builder only gets the parsed HTTP request, so something like a :client-method: option would need a small change in sphinxcontrib-httpexample first.

If that seems worth doing, I’m happy to help with a follow-up

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

Labels

None yet

Projects

Status: PoC / Draft
Status: In Progress
Status: Plan approved

Development

Successfully merging this pull request may close these issues.

Add @plone/client tab to REST API httpexample docs

4 participants