Skip to content

Update API specification to follow common guidelines#25

Open
DanXu-ChinaTelecom wants to merge 1 commit intomainfrom
DanXu-ChinaTelecom-specification
Open

Update API specification to follow common guidelines#25
DanXu-ChinaTelecom wants to merge 1 commit intomainfrom
DanXu-ChinaTelecom-specification

Conversation

@DanXu-ChinaTelecom
Copy link
Collaborator

What type of PR is this?

Add one of the following kinds:

  • enhancement/feature

What this PR does / why we need it:

Check design guidelines from Commonalities applied

Which issue(s) this PR fixes:

Fixes ##24

Special notes for reviewers:

Changelog input

 release-note

Additional documentation

This section can be blank.

docs

@hdamker
Copy link
Contributor

hdamker commented Nov 19, 2024

@DanXu-ChinaTelecom there are some points which are not yet in line with the CAMARA Design Guidelines.

General:

  • There seem to be an issue with the files and file names:
    • Current in main is /code/API_definitions/S2CVPN3(2).yaml
    • The PR would not change that, but adding /code/API_definitions/S2CVPN4(1).yaml
  • both filenames are not valid, as it should be apiname.yaml, but more important the PR should change the existing YAML, not adding a new version in parallel
  • Due to the previous point is not possible to see which changes the PR is introducing
  • The operations are lacking documentation within the YAML

Some hints about further alignment potential in the following review comments. Hope they are helpful.

Copy link
Contributor

@hdamker hdamker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some hints to improve the alignment with the guidelines in Commonalities, not meant as a complete review.

@@ -0,0 +1,936 @@
openapi: "3.0.3"
info:
title: Site to Cloud VPN API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title shouldn't contain "API"

Suggested change
title: Site to Cloud VPN API
title: Site to Cloud VPN

description: |
##### Before starting to use the API, the developer needs to know about the below specified details :
* Site to Cloud VPN service endpoint The URL pointing to the RESTful resource of the Site to Cloud VPN API.
* Authentication Security access keys such as OAuth 2.0 client credentials used by client applications to invoke the Site to Cloud VPN API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider the documentation within Identity and Consent Management. It is not "such as" but clearly defined to be Client Credentials.

Suggested change
* Authentication Security access keys such as OAuth 2.0 client credentials used by client applications to invoke the Site to Cloud VPN API.
* Authentication Security access keys such as OAuth 2.0 client credentials used by client applications to invoke the Site to Cloud VPN API.


NOTE- The private physical link between CE and cloud PE is default deployed for one click calling, otherwise it is required to install the physical link, which is out of the scope of this API.

version: '0.1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version is wip until the repository is released, see release process in Release Management and API versioning in chapter 5 of API Design Guidelines in Commonalities:

Suggested change
version: '0.1'
version: wip

Comment on lines +19 to +21
servers:
- url: https://localhost:8080/webapi
description: develop server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please look for correct format of servers object in Commonalities, example in

Please define also the API name here, e.g. site-to-cloud-vpn, don't abbreviate it (it should correspond with the title.

Comment on lines +81 to +84
X-Correlator:
description: When the API Consumer includes the "X-Correlator" header in the request, the API provider must include it in the response with the same value that was used in the request
schema:
type: integer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please cf https://github.com/camaraproject/Commonalities/blob/main/documentation/API-design-guidelines.md#9-architecture-headers:

  • x-correlator instead of X-Correlator
  • format is string, not integer
  • there is a schema defined within Components section

Comment on lines +114 to +116
rent:
type: integer
description: "VPN monthly rental "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does an integer without a currency make sense here?

isProtected:
type: bool
description: Is Site to Cloud VPN protected
CEType:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and for many other parameters:

  • avoid abbreviations
  • lowerCamelCase

content:
application/json:
schema:
type: object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This object has lot in common with S2CVPNOrder. Maybe it would make sense to define a base object in Components and derive the other object type from it?

@DanXu-ChinaTelecom
Copy link
Collaborator Author

@hdamker thanks a lot for your careful review, we'll check all the comments and handle the related issues.

@hdamker
Copy link
Contributor

hdamker commented Apr 16, 2025

/easycla

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants