Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rule: The items property for Schema Objects, or schema-like objects (non-body parameters), MUST be required when type is set to array #1962

Closed
veronicagg opened this issue Mar 8, 2017 · 6 comments
Assignees
Labels
P2 - Requested Feature Request

Comments

@veronicagg
Copy link
Contributor

veronicagg commented Mar 8, 2017

 M2042: The items property for Schema Objects, or schema-like objects (non-body parameters), MUST be required when type is set to array. More details can be found at OAI/OpenAPI-Specification#174.
Category: SDK Violation
Severity: Warning

@dsgouda
Copy link
Contributor

dsgouda commented May 24, 2017

Wondering if this can be an error.

@veronicagg
Copy link
Contributor Author

@dsgouda what impact does it have if the type is not set to array?

@dsgouda
Copy link
Contributor

dsgouda commented May 24, 2017

Tried generating CSharp client using AutoRest with a model property of type without "items" defined, AutoRest throws an exception.
We can still keep this validation rule just to warn the user.
@veronicagg thoughts?
@fearthecowboy do you think we should make AutoRest consider some sort of a default when the "items" is not defined for "array" type

@veronicagg
Copy link
Contributor Author

@dsgouda if autorest decides to implement a default, then I wouldn't implement the rule.
If autorest does not implement a default, we can implement this rule as a SDK Violation error, since not following the rule prevents code generation.
Thanks!

@veronicagg
Copy link
Contributor Author

@dsgouda
Copy link
Contributor

dsgouda commented Jun 13, 2017

Merged, pending publishing of new validator package

@dsgouda dsgouda closed this as completed Jun 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 - Requested Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants