example-value-no-mapping
@azure-tools/typespec-client-generator-core/example-value-no-mappingSeverity: warning
This diagnostic is issued when a value from an example file cannot be matched to the TypeSpec definition.
Impact
Section titled “Impact”- Area: Example value conversion. Generation continues, but the mismatched example value is not mapped into SDK example data for the operation.
- Not affected: The operation signature and generated client method are unchanged.
❌ Incorrect Usage
Section titled “❌ Incorrect Usage”@servicenamespace TestClient { @route("/{b}") op parametersDiagnostic( // example file provides unmapped parameter `test` for this operation @header a: string,
@path b: string, @query c: string, @body d: string, ): void;}Diagnostic Message
Section titled “Diagnostic Message”TCGC reports:
Value in example file 'parametersDiagnostic.json' does not follow its definition:{"test":"a"}✅ How to Fix
Section titled “✅ How to Fix”Update the example value or the TypeSpec definition so parameters, request bodies, and responses follow the declared shapes.
@servicenamespace TestClient { @route("/{b}") op parametersDiagnostic( @header a: string, @path b: string, @query c: string, @query test: string, @body d: string, ): void;}Suppression
Section titled “Suppression”This diagnostic should not be suppressed. Fix the example so its values map to the TypeSpec definition.