Skip to content

DistanceUnitMapping is not consistent with the gateway spec #2037

@mvanschellebeeck

Description

@mvanschellebeeck

Problem

Gateway defines a DistanceUnit as one of:

        - MILLIMETERS
        - CENTIMETERS
        - METERS
        - KILOMETERS
        - INCHES
        - FEET
        - YARDS
        - MILES
        - NAUTICAL_MILES

but osdk-ts allows lowercase and plural equivalents through a mapping here:

export const DistanceUnitMapping: {
centimeter: "CENTIMETERS";
centimeters: "CENTIMETERS";
cm: "CENTIMETERS";
meter: "METERS";
meters: "METERS";
m: "METERS";
kilometer: "KILOMETERS";
kilometers: "KILOMETERS";
km: "KILOMETERS";
inch: "INCHES";
inches: "INCHES";
foot: "FEET";
feet: "FEET";
yard: "YARDS";
yards: "YARDS";
mile: "MILES";
miles: "MILES";
nautical_mile: "NAUTICAL_MILES";
nauticalMile: "NAUTICAL_MILES";
"nautical miles": "NAUTICAL_MILES";
} = {

Desired state

osdk-ts should restrict units to the options in the spec and not offer a mapping to keep the SDKs consistent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions