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

Linting rules problem with Traffic Influence API #161

Closed
FabrizioMoggio opened this issue Mar 8, 2024 · 1 comment · Fixed by #169
Closed

Linting rules problem with Traffic Influence API #161

FabrizioMoggio opened this issue Mar 8, 2024 · 1 comment · Fixed by #169
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@FabrizioMoggio
Copy link
Collaborator

Problem description
Using Spectral over the TI API a non correct error is returned.

camaraproject/EdgeCloud#191 (comment)

Expected action
Correction of: https://github.com/camaraproject/Commonalities/blob/main/artifacts/linting_rules/.spectral.yml.
Section starting on raw 103: "camara-http-methods:"

Additional context
According to my understanding, the tool doesn't recognize some methods as GET, PATCH and DELETE. Even if they actually are GET, PATCH and DELETE. I suppose the reason is that in the TI API, we defined "parameters" as child of "paths" rather than child of the "methods". Our implementation is correct according to the OpenAPI Specifications (https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#path-item-object). We have used the "parameters" description as child of "path". With our solution we avoid duplicating the parameter definition for the different methods (Get, Patch and Delete). With the suggested approach we should define the same parameter three times in the code with the risk of code misalignment.

Reference in the TI API: raw 2012
https://github.com/camaraproject/EdgeCloud/blob/32c7ca4faf54fc14fa510c1212f34a0f43a42bfd/code/API_definitions/Traffic%20Influence/Traffic_Influence.yaml

@FabrizioMoggio FabrizioMoggio added the documentation Improvements or additions to documentation label Mar 8, 2024
@rartych
Copy link
Collaborator

rartych commented Mar 11, 2024

Thank you @FabrizioMoggio for pointing this out with detailed context.
The rule "camara-http-methods" should be corrected with "parameters" field in the Path Item object.

@rartych rartych self-assigned this Mar 11, 2024
rartych added a commit that referenced this issue Apr 15, 2024
…lem-trafficInfluenceAPI

[Bugfix]: Linting rules problem with Traffic Influence API #161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants