Skip to content

[AP] cleanup specfiles and sidebar - #872

Merged
ElliotFriend merged 41 commits into
mainfrom
ap/consolidate-specfiles
Aug 13, 2024
Merged

ElliotFriend merged 41 commits into
mainfrom
ap/consolidate-specfiles

Conversation

@ElliotFriend

@ElliotFriend ElliotFriend commented Aug 5, 2024 •

Copy link
Copy Markdown
Contributor

What's this, then?

To get the site ready for us to add docs versioning to AP (#345), there is some preparation that should be done. First, was upgrading to docusaurus v3, and now it's cleaning up a bit how we have docusaurus handling the AP files. This PR aims to tackle that second part.

We're consolidates the callback, platform, and custody specfiles into a single main.yaml file (notwithstanding the external schemas, etc. files). (Edit: We're not consolidating, but still doing some cleanup) This also upgrades the SDP specfile to openapi v3.1, and fixes some spec errors in the file.

Remains to be done:

  • reconfigure build to break on broken links
  • add some nginx redirects since some URL paths get shifted up a directory

TL;DR

There's a lot happening in this PR, so here's a recap of what I've done:

  • consolidated the three distinct API specifications into a single specfile
  • made the rpc spec behave/generate more like the soroban rpc spec (including the documentation pages generated from it)
  • fiddled with the sidebar definition so we don't need to custom-code a generator
  • because the custom sidebar generator is no more, i had to make some sidebar adjustments to the SDP docs, too. no big changes there, though.
  • other bits-n-bobs related to the redocly cli (updates, configs, etc.)

@stellar-jenkins

Copy link
Copy Markdown

Something went wrong with PR preview build please check

@stellar-jenkins

Copy link
Copy Markdown

Something went wrong with PR preview build please check

@stellar-jenkins

Copy link
Copy Markdown

Something went wrong with PR preview build please check

@stellar-jenkins

Copy link
Copy Markdown

Something went wrong with PR preview build please check

@stellar-jenkins

Copy link
Copy Markdown

Something went wrong with PR preview build please check

@ifropc ifropc left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do you mind adding a small README in /openrpc folder to maybe add some information on how to add new method? (I think changing existing methods is relatively straight-forward but if you think it should also be documented it'd be a nice addition as well)

Comment thread openapi/anchor-platform/main.yaml Resolved
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
tags:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Everything below is copy of Platform API + Custody API right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

correct

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually, Platform API + Custody API + Callbacks API

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Got it, any reason for merging them back together? I liked the previous one because it's easy to navigate, but don't have any strong preference.
Also cc @philipliu for opinion on merging this yaml files together

@philipliu philipliu Aug 8, 2024 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer if we could keep them separate, although 1 file makes the migration easier, that's fine too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The reasoning was that it's a bit of a "pre-emptive" move for the versioning setup. It would be much simpler to coordinate and manage the versions of a single specification file, rather than 3 or 4 different files.

That said, my mind has been moving in the same direction as you both over the last couple days. I think there are a couple options to address it. I'm gonna dig a bit into the versioning capabilities of the openapi plugin we're using, as well as this experimental join command in the Redocly CLI. I think both could provide a reasonable option for what we're after (which is: A useful, maintainable specfile (or set of them) that cleanly and nicely generates the documentation pages for us).

ifropc
ifropc previously approved these changes Aug 7, 2024
@ifropc
ifropc self-requested a review August 7, 2024 20:49
Comment thread openrpc/README.md Resolved
@ifropc

ifropc commented Aug 8, 2024

Copy link
Copy Markdown

LGTM, thanks @ElliotFriend ! We can always get back to splitting API files later on

@stellar-jenkins

Copy link
Copy Markdown

Something went wrong with PR preview build please check

@stellar-jenkins

Copy link
Copy Markdown

Something went wrong with PR preview build please check

@stellar-jenkins

Copy link
Copy Markdown

Something went wrong with PR preview build please check

@ElliotFriend

Copy link
Copy Markdown
Contributor Author

Updates since last major review:

  • We've gone back to keeping the various specs of the Anchor Platform as different files. file management in the repo is a little more cumbersome, but the trade-offs are worth it.
  • The sidebar is generated now in a much simpler manner, it's just an autogenerated directory 🎉
  • The redocly CLI is configured to include and manage commands for the different parts of the AP specs
  • The sidebar is now "flattened" out a bit more, so there are fewer dropdowns that need to be navigated through for users
  • I've moved the RPC spec documentation into the "Platform Server" category, since the methods exist on the same instance/server. (we can easily undo this, it felt like it made some sense, though?)

Here's the PR Preview:
https://developers-pr872.previews.kube001.services.stellar-ops.com/platforms/anchor-platform

Would love another review to see how we think this'll work out.

@ElliotFriend
ElliotFriend requested a review from philipliu August 13, 2024 18:39
@ElliotFriend ElliotFriend changed the title [AP] consolidate specfiles into one main file [AP] cleanup specfiles and sidebar Aug 13, 2024
@ElliotFriend
ElliotFriend merged commit b4a2c49 into main Aug 13, 2024
@ElliotFriend
ElliotFriend deleted the ap/consolidate-specfiles branch August 13, 2024 21:06
janewang pushed a commit that referenced this pull request Sep 12, 2024
* start on consolidated AP specfile

* fine-tune some yaml formatting

* move and regenerate anchor-platform api docs

* re-throw on broken links, comment it instead of removing

* make binary file schemas typed as string

https://swagger.io/docs/specification/data-models/data-types/#file

* remove old hand-written category files

* delete old yaml files

* rename files yml -> yaml

* upgrade sdp specfile to openapi v3.1

* rearrange tags in sdp specfile

* reconfig and regenerate sdp spec pages

* remove unused sidebar generator and cleanup config file

* remove unnecessary README files

* fix broken links and anchors

* abstract rpc generation so it can be used for anchor platform, too

* first step toward a generated rpc specfile

* modify rpc method component to take objects instead of strings

* embed examples in rpc spec

* fix a broken link

* remove now unused react component

* correct a filepath in rpc spec validation script

* check that directories exist while building rpc specfiles

* fix some example and schema validation errors

* regenerate specfile docs

* update redocly cli

* improve redocly configs

* regenerate api docs

* remove unnecessary rpc specfile

* modify metamask patch to display relevant server URL for AP

* update openrpc README with some better instructions

* experiment with things apart again

* re-separate anchor platform specfiles into distinct specs

* fix broken links and config to throw on them again

* better word choice

* fix filepath in rpc build script
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

Successfully merging this pull request may close these issues.

4 participants