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

feat(cli): [WIP] Add support for OpenAPI input w/out fs #5281

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

amckinney
Copy link
Contributor

This starts to split out the abstractions required to parse the OpenAPI file directly as input rather than interacting with the user's local filesystem. The primary goal of this exploration is to make it possible to generate Fern's IR directly in the browser.

Challenges:

  1. Far reaching usage of node and/or FS libraries (e.g. path, fs, stream, os, util, etc).
    • The transitive closure of the IR generator and the dynamic snippets generator cannot reference any of these libraries.
      • This includes @fern-api/go-ast, @fern-api/generator-commons, etc, which already include heavy use.
    • If we don't incorporate any tree-shaking, all packages referenced must omit these Node-specific libraries.
  2. Update the @fern-api/go-dynamic-snippets to consume the latest dynamic IR.
    • The dynamic IR purposefully enables noSerdeLayer to reduce the size of the library for browser use.
    • This causes an incompatibility with the generated fern-fern/ir-sdk and fern-api/dynamic-ir-sdk types due to the custom _type discriminator in the dynamic IR.
    • In order for these to be consistent and have the monorepo in a compile-able state we have two options:
      1. Maintain a mapper between the types.
      2. Update the dynamic IR so that the results between noSerdeLayer: {false, true} are always consistent

Copy link

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

Successfully merging this pull request may close these issues.

1 participant