Azure / Azure/azure-openapi-validator

Remove redundant allOf references

Open
#132 0 comments 0 reactions 0 assignees View on GitHub
sdk-rule
Dominant language
TypeScript
Stars
53
Forks
57
Avg merge
1d 23h
Merged PRs (30d)
2

Description

I have seen at so many places that a model itself has no properties and is simply an allOf on the parent. In such a case why do we have that model? Can we get away with those models? It reduces complexity.

For example: In the [SpellCheck](https://github.com/Azure/azure-rest-api-specs/blob/current/specification/cognitiveservices/data-plane/SpellCheck/V1.0/SpellCheck.json) swagger model,

[SpellCheck](https://github.com/Azure/azure-rest-api-specs/blob/current/specification/cognitiveservices/data-plane/SpellCheck/V1.0/SpellCheck.json#L250) `--allOf-->` [Answer](https://github.com/Azure/azure-rest-api-specs/blob/current/specification/cognitiveservices/data-plane/SpellCheck/V1.0/SpellCheck.json#L269) (no properties) `--allOf-->` [Response](https://github.com/Azure/azure-rest-api-specs/blob/current/specification/cognitiveservices/data-plane/SpellCheck/V1.0/SpellCheck.json#L319) (no properties) `--allOf-->` [Identifiable](https://github.com/Azure/azure-rest-api-specs/blob/current/specification/cognitiveservices/data-plane/SpellCheck/V1.0/SpellCheck.json#L350)

There are no references to Answer and Response apart from the allOf references. It would be nice to get rid of them.
- SpellCheck --allOf--> Identifiable
- ErrorResponse --allOf--> Identifiable

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.