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

chore: API Reference now uses Api Definition V2 #1608

Merged
merged 36 commits into from
Oct 10, 2024

Conversation

abvthecity
Copy link
Contributor

@abvthecity abvthecity commented Oct 8, 2024

In this PR:

  • delete Resolved API types
  • delete the /api/fern-docs/resolve-api endpoint
  • change all shape: TypeReference to shape: TypeShape because TypeShape is more flexible (allows you to specify TypeReference via an alias. This lets us unwrap websocket variants more smoothly.
  • deletes schemaWithExample
  • updates the resolveDocsContent to adopt the new typings
  • update all api reference components to use the new typings
  • in some cases, fixes the descriptions field (but not in all cases)
  • fixes dropped globalHeaders in api playground
  • delete the InternalTypeDefinitionError (in favor of just InternalTypeDefinition) for simplicity (also it's not implemented correctly anyway)
  • refactor ApiPackageContents -> ApiDefinitionContent to use a flattened array instead of recursion. (eventually this will be used to collapse / summarize api sections)
  • improved memoization of ApiDefinition
  • update tests and snapshots

the following functionality has been commented out because it no longer works:

  • EndpointRequestSnippet no longer links back to the api reference (we can precompute this somewhere)

@abvthecity abvthecity had a problem deploying to Preview - app-dev.buildwithfern.com October 8, 2024 17:21 — with GitHub Actions Failure
@abvthecity abvthecity had a problem deploying to Preview - app.buildwithfern.com October 8, 2024 17:21 — with GitHub Actions Failure
@abvthecity abvthecity had a problem deploying to Preview - app.buildwithfern.com October 8, 2024 19:30 — with GitHub Actions Failure
@abvthecity abvthecity had a problem deploying to Preview - app-dev.buildwithfern.com October 8, 2024 19:30 — with GitHub Actions Failure
@abvthecity abvthecity had a problem deploying to Preview - app.buildwithfern.com October 8, 2024 22:31 — with GitHub Actions Failure
@abvthecity abvthecity had a problem deploying to Preview - app-dev.buildwithfern.com October 8, 2024 22:31 — with GitHub Actions Failure
Copy link

github-actions bot commented Oct 8, 2024

@abvthecity abvthecity had a problem deploying to Preview - app.buildwithfern.com October 8, 2024 23:31 — with GitHub Actions Failure
@abvthecity abvthecity had a problem deploying to Preview - app-dev.buildwithfern.com October 8, 2024 23:31 — with GitHub Actions Failure
Copy link

github-actions bot commented Oct 9, 2024

@abvthecity abvthecity changed the title stash chore: API Reference now uses Api Definition V2 Oct 9, 2024
@abvthecity abvthecity marked this pull request as ready for review October 9, 2024 02:33
@abvthecity abvthecity requested a review from dsinghvi as a code owner October 9, 2024 02:33
Copy link

github-actions bot commented Oct 9, 2024

Copy link

github-actions bot commented Oct 9, 2024

Copy link

github-actions bot commented Oct 9, 2024

Copy link

github-actions bot commented Oct 9, 2024

Copy link

github-actions bot commented Oct 9, 2024

@@ -60,7 +60,7 @@ types:
- commons.WithAvailability
properties:
key: rootCommons.PropertyKey
valueShape: TypeReference
Copy link
Member

Choose a reason for hiding this comment

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

could this break any consumer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no it won't, all the consumers use unwrapReference which accepts TypeShape | TypeReference

@@ -12,73 +12,73 @@ export type ExpectedCodeBlockChildren = {
};
};

export function stringHasMarkdown(s: string): boolean {
s = s.trim();
// export function stringHasMarkdown(s: string): boolean {
Copy link
Member

Choose a reason for hiding this comment

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

why are we commenting this out instead of deleting? is the idea to bring this back?

@abvthecity abvthecity merged commit 41de5ab into main Oct 10, 2024
22 of 23 checks passed
@abvthecity abvthecity deleted the ajiang/api-definition-migrate-2 branch October 10, 2024 12:39
@dsinghvi
Copy link
Member

didn't mean to auto merge this cause it would be valuable to understand the stringHasMarkdown change

@dsinghvi dsinghvi restored the ajiang/api-definition-migrate-2 branch October 10, 2024 12:40
dsinghvi added a commit that referenced this pull request Oct 10, 2024
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.

2 participants