Preserve service path types across schema APIs - #107
Draft
KidkArolis wants to merge 3 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
ServicecreateSchema()ServicePaths,ServiceByPath, andServiceByIdentifierServiceItemandServiceQueryto resolve either namespaceWhy
The generated service declaration already carries both an ergonomic schema name and a literal transport path, but Figbird's
service()return type discarded the path generic. Downstream consumers could therefore only recover the schema key, forcing applications with aliased paths to maintain a parallel legacy service lookup.Preserving both identifiers in the real schema lets each API deliberately expose the namespace it actually speaks, without duplicate schemas or casts.
Impact
Applications can use one schema for named builder APIs such as
q.peopleandm.people, while legacy hooks and raw Feathers access remain correctly typed with paths such asapi/people.Existing services without an explicit path retain their schema key as the literal default path.
Validation
npm run tscnpm run lintnpm run ava— 357 tests passednpm run test— type-checking, lint, formatting, coverage, and all 357 tests passed