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

refactor: migrate swagger to use [email protected] #192

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

ShookLyngs
Copy link
Collaborator

@ShookLyngs ShookLyngs commented Jul 11, 2024

Changes

Migration

This migration should resolve an issue where, if a schema uses anyOf for type annotation, the model is rendered blank in the documentation. The anyOf/oneOf/not fields were officially supported with the release of [email protected]. Since we were using [email protected], those fields were unsupported. Ref: What is OpenAPI 3.0? | Swagger Blog.

In our codebase, any usage of z.union will eventually be transformed to using anyOf:

const Nullable1 = z.union([z.string(), z.null()]);
const Nullable2 = z.string().or(z.null());
const Nullable3 = z.string().nullable();

This affects a wide range of schemas:

  1. The ckb_virtual_result in the params of the /rgbpp/v1/transaction/ckb-tx API
  2. The txs in the response of the /rgbpp/v1/address{btc_address}/activity API
  3. Other schemas that use z.union, z.null or z.or

@ShookLyngs ShookLyngs requested review from Flouse and ahonn July 11, 2024 16:03
Copy link

vercel bot commented Jul 11, 2024

@ShookLyngs is attempting to deploy a commit to the Cell Studio Team on Vercel.

To accomplish this, @ShookLyngs needs to request access to the Team.

Afterwards, an owner of the Team is required to accept their membership request.

If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account.

@ahonn ahonn merged commit a857c78 into develop Jul 12, 2024
2 of 3 checks passed
@ahonn ahonn deleted the ref/migrate-to-openapi-3.1 branch July 12, 2024 00:33
@ahonn
Copy link
Collaborator

ahonn commented Jul 12, 2024

LGTM, looks awesome

image

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.

The response docs of /rgbpp/v1/address/{btc_address}/activity is incomplete
3 participants