Allow @encode(string) on boolean, define case-insensitive true|false string semantics, and add Spector coverage + generic string matcher support#10875
Conversation
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
@encode(string) on boolean and define true|false string semantics
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
@encode(string) on boolean and define true|false string semantics@encode(string) on boolean, define true|false string semantics, and add Spector coverage
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
|
@copilot formatting also failing run formatter |
|
You can try these changes here
|
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Fixed in f095d13: I regenerated compiler definitions ( |
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
|
@copilot add changelogs |
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
|
All changed packages have been documented.
Show changes
|
|
@copilot need to regen docs shows as modified. Also show an example of usage in the changelog entry as per comment |
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
@encode(string)was restricted to numeric targets, blocking APIs that model booleans as strings (for example"true"/"false"in payloads or query values). This change extends support to boolean targets, clarifies the docs contract, and adds http-specs Spector coverage.Compiler validation
@encodevalidation so the implicit string encoding path (@encode(string)) is valid forbooleanin addition tonumeric.Standard library/docs contract
@encodedecorator docs to state boolean string encoding uses case-insensitivetrue/falsevalues.@encode(string)example.Coverage
@encode(string)on a boolean model property.packages/http-specs/specs/encode/booleanwith matching mock API and regeneratedpackages/http-specs/spec-summary.md./encode/boolean/property/true-lower/encode/boolean/property/false-lower/encode/boolean/property/true-upper/encode/boolean/property/false-mixedtrue/false), while still returning varied response casings for coverage.Spector standard matcher support
@typespec/spec-api:match.string.caseInsensitive(string).match.string.caseInsensitive(String(requestValue))).packages/spec-api/test/matchers/string.test.ts.