Azure / Azure/oav

validate-example expects path parameters in examples to be of string type

Open
#1,078 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
104
Forks
62
Avg merge
2d 12h
Merged PRs (30d)
5

Description

Hi,

While working on the TypeSpec for Microsoft Planetary computer, we found that oav and TypeSpec tools validate examples differently. Specifically, if a path parameter is a number, oav still expects it to be a string. Emitters such as Python would throw a warning if a string is used.

For example

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/orbital/Microsoft.PlanetaryComputer/examples/2025-04-30-preview/MosaicsTileMatrixSets_GetZxyScalexFormat.json

```
warning @azure-tools/typespec-client-generator-core/example-value-no-mapping: Value in example file '2025-04-30-preview/MosaicsTiles_GetZxyScalexFormat.json' does not follow its definition:
"1"
```

Can oav align with TypeSpec tools in how to handle numeric path parameters?

Thanks,
Youssef

Contributor guide

Open the contributing guide

Research direction

Start with the linked MosaicsTileMatrixSets_GetZxyScalexFormat.json example and trace how oav validates numeric path parameters against example values. Compare that behavior with the TypeSpec tool behavior described in the issue; done means numeric path parameters are handled consistently without the reported warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.