Overview
Umbrella tracking issue for serialization/deserialization refinements in the TypeScript emitter (@azure-tools/typespec-ts, modular). Migrated from Azure/autorest.typescript, which is being retired in favor of this repo.
Work items
1. Additional properties ser/deser follow-ups
Improve ser/deser logic for both legacy and non-legacy formats:
2. General ser/deser refinement
3. Separate error and body deserialization (nice-to-have)
Notes
- Test coverage is tracked as part of each fix above, not as standalone issues.
Overview
Umbrella tracking issue for serialization/deserialization refinements in the TypeScript emitter (
@azure-tools/typespec-ts, modular). Migrated from Azure/autorest.typescript, which is being retired in favor of this repo.Work items
1. Additional properties ser/deser follow-ups
Improve ser/deser logic for both legacy and non-legacy formats:
...Record<utcDateTime>, the generated serializer callsserializeRecord(item.additionalProperties ?? {})without a value serializer, soDatevalues are emitted raw instead of being encoded to the wire format. (Verified locally.)unixTimestampvalue of0— for an optional@encode("unixTimestamp")date, the deserializer generates!item["value"] ? item["value"] : new Date(item["value"] * 1000); when the value is0,!0is truthy so the raw0is returned instead ofnew Date(0). (Required fields are handled correctly.)2. General ser/deser refinement
packages/typespec-ts/test/modularUnit/serializeUtil3. Separate error and body deserialization (nice-to-have)
_xxxDeserializecurrently bundles the error-status check and body deserialization in a single function. Extract the error-checking part into a reusable helper that can be called without consumingresult.body, so callers (e.g. StoragesubmitBatch) don't do unnecessary work or consume the body.Notes