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

LintDiff: False positives for XmsClientNameParameter #7887

Open
cataggar opened this issue Mar 15, 2024 · 1 comment
Open

LintDiff: False positives for XmsClientNameParameter #7887

cataggar opened this issue Mar 15, 2024 · 1 comment
Assignees
Labels
Central-EngSys This issue is owned by the Engineering System team. Spec PR Tools Tooling that runs in azure-rest-api-specs repo.

Comments

@cataggar
Copy link
Member

Very similar to #7886 for XmsClientName, but this is for XmsClientNameParameter. It is the same paths, except it is for x-ms-client-name.

The errors look like:

{"pluginName":"spectral","extensionName":"@microsoft.azure/openapi-validator","level":"warning","message":"Value of `x-ms-client-name` cannot be the same as Property/Model.","code":"XmsClientNameParameter"
      - $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}"].put.parameters[5] # addon

Looks like it is complaining that addon is both the name and x-ms-client-name.

          {
            "name": "addon",
            "in": "body",
            "description": "Resource create parameters.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/Addon"
            },
            "x-ms-client-name": "addon"
          }

The TypeSpec currently has this for compatibility with previous API version:

@@projectedName(Addons.createOrUpdate::parameters.resource, "json", "addon");
@@OpenAPI.extension(Addons.createOrUpdate::parameters.resource,
  "x-ms-client-name",
  "addon"
);

I'll see if I can remove the x-ms-client-name.

@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 15, 2024
@cataggar
Copy link
Member Author

If I remove

@@OpenAPI.extension(Addons.createOrUpdate::parameters.resource,
  "x-ms-client-name",
  "addon"
);

It defaults to resource. The previous API version used addon, so it is a breaking change.

image

cataggar added a commit to cataggar/azure-rest-api-specs that referenced this issue Mar 15, 2024
@kurtzeborn kurtzeborn added Central-EngSys This issue is owned by the Engineering System team. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Apr 1, 2024
@konrad-jamrozik konrad-jamrozik changed the title False positives for XmsClientNameParameter LintDiff: False positives for XmsClientNameParameter Apr 1, 2024
@konrad-jamrozik konrad-jamrozik added the Spec PR Tools Tooling that runs in azure-rest-api-specs repo. label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central-EngSys This issue is owned by the Engineering System team. Spec PR Tools Tooling that runs in azure-rest-api-specs repo.
Projects
Status: 📋 Backlog
Status: 📋 Backlog
Development

No branches or pull requests

3 participants