Skip to content

Misleading endpoint name /iolink/v2/gateway/configuration #212

@thbauer-pepperl-fuchs

Description

@thbauer-pepperl-fuchs

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

  1. Rename endpoint from /iolink/v2/gateway/configuration to /iolink/v2/gateway/network
  2. Rename property from ipConfiguration to ipAddressMethod or ipAssignmentMethod
  3. 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
  4. Update documentation to clearly explain the different IP assignment methods and their respective
    required/optional fields
  5. Use proper OpenAPI attributes like readOnly and writeOnly where properties differ between GET and POST
    operations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions