Draft
Conversation
BREAKING CHANGES: - Renamed type helpers to shorter, more intuitive names: - GetResponseData<Ops, Op> → ApiResponse<Op> - GetRequestBody<Ops, Op> → ApiRequest<Op> - GetPathParameters<Ops, Op> → ApiPathParams<Op> - GetQueryParameters<Ops, Op> → ApiQueryParams<Op> - Old type names removed entirely (no backward compatibility) - Made isQueryMethod/isMutationMethod internal (not exported) Changes: - Removed types-documentation.ts - docs now inline in types.ts - Simplified index.ts exports - Added inline JSDoc to QQueryOptions/QMutationOptions - Updated CLI to generate simplified type aliases - Removed direct components/operations type access from tests - Added USAGE.md with concise usage examples - Added readonly property handling tests
- Merged readonly-library-integration.test.ts into readonly-properties.test.ts - Removed 13 duplicate tests - Organized into logical describe blocks: - ApiResponse - Response Types - ApiRequest - Mutation Request Bodies - ApiPathParams and ApiQueryParams - OpType Namespace - Integration with useOpenApi - Test count: 290 → 277 (removed duplicates)
- Verifies status can be omitted (optional)
- Verifies status accepts enum values ('available' | 'pending' | 'sold')
- Verifies invalid enum values are rejected
- Verifies optional chaining required when accessing status
BREAKING CHANGE: - ApiResponse now makes ALL fields required regardless of 'required' status - No null checks needed for any response fields - Assumes reliable backend that always returns complete objects New: - ApiResponseSafe type for unreliable backends - Only readonly fields required, others preserve optional status This simplifies consumer code by eliminating null checks for response fields that the server should always return.
- Updated all docs/manual/*.md files to use OperationId.X pattern - Added import statements for OperationId where needed - Updated JSDoc examples in src/types.ts and src/index.ts - Ensures consistency across all documentation and examples
- CLI now generates api-enums.ts with const enum objects
- Enums named as {SchemaName}{PropertyName} in PascalCase
- Automatic deduplication of identical enum value sets
- Type-safe usage: PetStatus.Available instead of 'available'
- Added 7 new tests for enum extraction
- Updated USAGE.md and docs with enum examples
- Updated docs/manual/02-queries.md and 04-reactive-parameters.md - Updated USAGE.md to use PetStatus enum - Updated src/types.ts JSDoc examples - Updated tests to use PetStatus enum - Added api-enums.ts fixture for tests - Fixed openapi-types.ts fixture to use 'adopted' instead of 'sold' - Added backward compatibility test showing string literals still work
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.
Summary
This PR introduces a cleaner, more intuitive type API with simplified type helper names.
Breaking Changes
Renamed type helpers (old names removed):
GetResponseData<Ops, Op>ApiResponse<Op>GetRequestBody<Ops, Op>ApiRequest<Op>GetPathParameters<Ops, Op>ApiPathParams<Op>GetQueryParameters<Ops, Op>ApiQueryParams<Op>Internal helpers (no longer exported):
isQueryMethod→ internalisMutationMethod→ internalImprovements
types-documentation.ts- type documentation now inlineindex.tsexports structureQQueryOptionsandQMutationOptionspropertiescomponents/operationstype access from tests/examplesUSAGE.mdwith concise usage examplesMigration Guide
Update your type imports and usage:
Test Results