generated from camaraproject/Template_API_Repository
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Update CAMARA_common.yaml: add Device headers, fix address #120
Open
Kevsy
wants to merge
2
commits into
camaraproject:main
Choose a base branch
from
Kevsy:patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,31 @@ info: | |
version: 0.4.0 | ||
paths: {} | ||
components: | ||
parameters: | ||
IPv4-Address: | ||
in: header | ||
name: IPv4-Address | ||
required: false | ||
schema: | ||
$ref: "#/components/schemas/DeviceIpv4Address" | ||
IPv6-Address: | ||
in: header | ||
name: IPv6-Address | ||
required: false | ||
schema: | ||
$ref: "#/components/schemas/DeviceIpv6Address" | ||
Phone-Number: | ||
in: header | ||
name: Phone-Number | ||
required: false | ||
schema: | ||
$ref: "#/components/schemas/PhoneNumber" | ||
Network-Access-Identifier: | ||
in: header | ||
name: Network-Access-Identifier | ||
required: false | ||
schema: | ||
$ref: "#/components/schemas/NetworkAccessIdentifier" | ||
schemas: | ||
TimePeriod: | ||
properties: | ||
|
@@ -55,7 +80,7 @@ components: | |
networkAccessIdentifier: | ||
$ref: "#/components/schemas/NetworkAccessIdentifier" | ||
ipv4Address: | ||
$ref: "#/components/schemas/DeviceIpv4Addr" | ||
$ref: "#/components/schemas/DeviceIpv4Address" | ||
ipv6Address: | ||
$ref: "#/components/schemas/DeviceIpv6Address" | ||
minProperties: 1 | ||
|
@@ -71,7 +96,7 @@ components: | |
type: string | ||
example: "[email protected]" | ||
|
||
DeviceIpv4Addr: | ||
DeviceIpv4Address: | ||
type: object | ||
description: | | ||
The device should be identified by either the public (observed) IP address and port as seen by the application server, or the private (local) and any public (observed) IP addresses in use by the device (this information can be obtained by various means, for example from some DNS servers). | ||
|
@@ -83,9 +108,9 @@ components: | |
In all cases, publicAddress must be specified, along with at least one of either privateAddress or publicPort, dependent upon which is known. In general, mobile devices cannot be identified by their public IPv4 address alone. | ||
properties: | ||
publicAddress: | ||
$ref: "#/components/schemas/SingleIpv4Addr" | ||
$ref: "#/components/schemas/SingleIpv4Address" | ||
privateAddress: | ||
$ref: "#/components/schemas/SingleIpv4Addr" | ||
$ref: "#/components/schemas/SingleIpv4Address" | ||
publicPort: | ||
$ref: "#/components/schemas/Port" | ||
anyOf: | ||
|
@@ -95,7 +120,7 @@ components: | |
publicAddress: "84.125.93.10" | ||
publicPort: 59765 | ||
|
||
SingleIpv4Addr: | ||
SingleIpv4Address: | ||
description: A single IPv4 address with no subnet mask | ||
type: string | ||
format: ipv4 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using same format for all schemas? If we use UpperCamelCase for schema names, it is more coherent to use them as well here, e.g. Ipv4Address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By convention HTTP headers are Kebab-Case: RFC 2616, section 5.3. So
IPv4-Address
uses the same naming style because it is an HTTP Header. "DeviceIpv4Address" is the schema that the parameter is based on (which follows CAMARA UpperCamelCase convention for schema names).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Kevin,
Understood and OK to use kebab-case for the parameter property value. I checked with Jose, he was refering only to use UpperCamelCase for the schema name, just for aligment. Usually code generators also works better with schemas named following Camelcase. So it would read (just removing "-", for the new schemas included):
IPv4Address:
in: header
name: IPv4-Address
required: false
schema:
$ref: "#/components/schemas/DeviceIpv4Address"
WDYT?