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

Update CAMARA_common.yaml: add Device headers, fix address #120

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions artifacts/CAMARA_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ info:
version: 0.4.0
paths: {}
components:
parameters:
IPv4-Address:
Copy link
Contributor

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

Copy link
Collaborator Author

@Kevsy Kevsy Jan 29, 2024

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).

Copy link
Collaborator

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?

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:
Expand Down Expand Up @@ -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
Expand All @@ -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).
Expand All @@ -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:
Expand All @@ -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
Expand Down