Azure / Azure/azure-openapi-validator
[new rule]: In context of model, x-ms-flatten is allowed only in property name
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 57
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 2
Description
### Lint rule description
x-ms-flatten has a clear scope in models, and should be used only inside a property definition
### Related swagger example
This is incorrect:
https://github.com/Azure/azure-rest-api-specs/blob/70c71be6e655ecca5dff4ef7f53438e6755e3e70/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/namespaces-preview.json#L737
### Category
SDK
### Severity level
Error
### Applies to
Management plane API spec, Data plane API spec, RPaaS API spec
### How to fix the violation
Move the node to right place of what you want to flatten
### What't the impact if breaking the rule
Autorest is silently ignoring the property, which leads to confusion and people thinkings autorest is buggy
Contributor guide
Assessment
This issue has not been assessed yet.