non-conflicting-model-and-field-name
Overview
This rule belongs to the apimatic-codegen-validation
ruleset and states that:
A model's name must not conflict with names of its fields. This is because some languages do not allow member names to be the same name as their enclosing type. The accessor or variable names may be changed to address this problem.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | Field name conflicts with its model name which may cause code generation issues. |
Code | APIMATICCODEGEN_V136 |
Type | Validation |
Rule System | Semantic |
Broad Category | Global Types/Models |
Products Impacted | Code Generation, Developer Experience Portal |
Tags | apimatic code generation codegen sdks portal docs validation apimatic name field property type custom type model complex model |
Suggested Fixes
- Change the name of the model to avoid a conflict with its fields.
- Remove the field from the model declaration.
- Names are compared in a case-insensitive manner.