Conversation
…-continuation-token extension Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
…e example Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
.chronus/changes/copilot-add-continue-token-import-support-2026-1-6-18-0-30.md
Outdated
Show resolved
Hide resolved
commit: |
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
|
@copilot I forgot a scenario in the initial issue. The extension can also be present on a query parameter. In which case it need to be added to the parameter definition during the import to TypeSpec. Start by adding the test cases, and then change the code. |
…-continuation-token on parameters Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Added support for x-ms-list-continuation-token on query parameters. The implementation handles both scenarios:
Added 4 new test cases covering both scenarios with true/false values and TypeSpec output validation. All tests pass. Commit 7e8ccc3 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
The OpenAPI3 importer was not generating
@continuationTokendecorators when encountering thex-ms-list-continuation-tokenextension in property schemas or query parameters.Changes
Modified
decorators.ts:x-ms-list-continuation-tokenextension ingetDecoratorsForSchema()for model properties and parameter schemasgetParameterDecorators()for parameters with the extension directly on the parameter objecttrue, the importer now emits both@extensionand@continuationTokendecoratorsAdded test coverage:
Examples
Model Property
OpenAPI schema with the extension:
Now generates:
Query Parameter
OpenAPI parameter with the extension on schema:
Or with the extension on the parameter itself:
Both generate:
The
@typespec/openapiimport andusing OpenAPI;statement are already present in all conversions, so no additional imports are required.Original prompt
This section details on the original issue you should resolve
<issue_title>Add support for importing the continuationToken decorator based on the relevant OpenAPI extension</issue_title>
<issue_description>### Clear and concise description of the problem
Related https://github.com/microsoft/openai-openapi-pr/issues/568
Based on the following OpenAPI description, we should get the following TypeSpec definition imported