Azure / Azure/azure-openapi-validator

[new rule]: In context of model, x-ms-flatten is allowed only in property name

Open
#293 2 comments 0 reactions 0 assignees View on GitHub
p1 sdk-rule
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.