Skip to content
Discussion options

You must be logged in to vote
  • baseURL = where API requests go at runtime (your actual backend URL)
  • schema = where to get the OpenAPI spec file for generating types (build-time only)

They're completely different purposes. baseURL is runtime config, schema is dev/build-time.

For your setup:

openFetch: {
  clients: {
    api: {
      baseURL: 'http://localhost:8000', // actual API endpoint
      schema: 'http://localhost:8000/openapi.json' // where to fetch the spec
    }
  }
}

To your other questions:

  • clients.[name] — yeah, name it whatever you want (api, backend, myService, etc.)
  • schema optional? — kinda. If omitted, it looks for openapi/[clientName]/openapi.yaml by default
  • openapi folder needed? — only if you don't…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Norbiros
Comment options

Answer selected by Norbiros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants