The endpoint /iolink/v2/gateway/configuration has a misleading name and problematic API design that should be
addressed.
Problems
1. Misleading Endpoint Name
Current: /iolink/v2/gateway/configuration
Issue: The endpoint name suggests it contains the full device configuration, but it only handles Ethernet IPv4
addresses and network configuration.
Proposed Solution: Rename to /iolink/v2/gateway/network to clearly indicate it's network-specific configuration.
2. Inconsistent Property Naming
Current: ipConfiguration
Issue: The name doesn't clearly convey its purpose. Additionally, other protocols like DCP can also assign IP
addresses to devices, so the naming should reflect that this is about the IP address assignment method.
Proposed Solution: Rename to ipAddressMethod or ipAssignmentMethod to better describe what the property
controls.
3. Schema Design Issues
Current Description from Schema:
The properties ipAddress, subnetMask and standardGateway are only allowed for POST, if ipConfiguration is set to
MANUAL. They are mandatory for GET.
Issue: This indicates properties that are conditionally read-only or write-only, but the schema doesn't properly use
readOnly: true or writeOnly: true to reflect this.
Proposed Solution: The schema should use proper OpenAPI specifications:
- Use conditional schemas (oneOf) to represent different POST request structures
- Properly mark fields with
readOnly or writeOnly where applicable
4. API Structure for Different IP Configuration Modes
Current Issue: The API doesn't clearly differentiate between MANUAL and DHCP (or other methods like DCP) in the
request structure.
Proposed POST Request Structures:
Option A: Manual IP Configuration
{
"ethIpv4": [
{
"ipAddressMethod": "MANUAL",
"ipAddress": "192.168.1.13",
"subnetMask": "255.255.255.0",
"standardGateway": "192.168.1.1"
}
]
}
Option B: DHCP Configuration
{
"ethIpv4": [
{
"ipAddressMethod": "DHCP"
}
]
}
Option C: DCP or Other Protocols
{
"ethIpv4": [
{
"ipAddressMethod": "DCP"
}
]
}
Recommended Changes
- Rename endpoint from
/iolink/v2/gateway/configuration to /iolink/v2/gateway/network
- Rename property from
ipConfiguration to ipAddressMethod or ipAssignmentMethod
- Update schema to use OpenAPI
oneOf or anyOf to properly model the conditional structure:
- When
ipAddressMethod is MANUAL: require ipAddress, subnetMask, and standardGateway
- When
ipAddressMethod is DHCP, DCP, or other methods: these properties should not be included in POST
requests
- Update documentation to clearly explain the different IP assignment methods and their respective
required/optional fields
- Use proper OpenAPI attributes like
readOnly and writeOnly where properties differ between GET and POST
operations
The endpoint
/iolink/v2/gateway/configurationhas a misleading name and problematic API design that should beaddressed.
Problems
1. Misleading Endpoint Name
Current:
/iolink/v2/gateway/configurationIssue: The endpoint name suggests it contains the full device configuration, but it only handles Ethernet IPv4
addresses and network configuration.
Proposed Solution: Rename to
/iolink/v2/gateway/networkto clearly indicate it's network-specific configuration.2. Inconsistent Property Naming
Current:
ipConfigurationIssue: The name doesn't clearly convey its purpose. Additionally, other protocols like DCP can also assign IP
addresses to devices, so the naming should reflect that this is about the IP address assignment method.
Proposed Solution: Rename to
ipAddressMethodoripAssignmentMethodto better describe what the propertycontrols.
3. Schema Design Issues
Current Description from Schema:
Issue: This indicates properties that are conditionally read-only or write-only, but the schema doesn't properly use
readOnly: trueorwriteOnly: trueto reflect this.Proposed Solution: The schema should use proper OpenAPI specifications:
readOnlyorwriteOnlywhere applicable4. API Structure for Different IP Configuration Modes
Current Issue: The API doesn't clearly differentiate between MANUAL and DHCP (or other methods like DCP) in the
request structure.
Proposed POST Request Structures:
Option A: Manual IP Configuration
{ "ethIpv4": [ { "ipAddressMethod": "MANUAL", "ipAddress": "192.168.1.13", "subnetMask": "255.255.255.0", "standardGateway": "192.168.1.1" } ] }Option B: DHCP Configuration
{ "ethIpv4": [ { "ipAddressMethod": "DHCP" } ] }Option C: DCP or Other Protocols
{ "ethIpv4": [ { "ipAddressMethod": "DCP" } ] }Recommended Changes
/iolink/v2/gateway/configurationto/iolink/v2/gateway/networkipConfigurationtoipAddressMethodoripAssignmentMethodoneOforanyOfto properly model the conditional structure:ipAddressMethodisMANUAL: requireipAddress,subnetMask, andstandardGatewayipAddressMethodisDHCP,DCP, or other methods: these properties should not be included in POSTrequests
required/optional fields
readOnlyandwriteOnlywhere properties differ between GET and POSToperations