Skip to content

Fields id, name, type in KeyWithPayload or KeyRepresentation should not be optional #12

@CarstenLeue

Description

@CarstenLeue

Fields id, name, type in KeyWithPayload or KeyRepresentation are declared optional:

        /** Specifies the MIME type that represents the key resource. Currently, only the default is supported. */
        type?: string;
        /** The v4 UUID used to uniquely identify the resource, as specified by RFC 4122. */
        id?: string;
        /** A human-readable name to assign to your key.
         *
         *  To protect your privacy, do not use personal data, such as your name or location as the name for your key.
         */
        name?: string;

But why would these fields ever be null for a newly created key or for a listing of a key. It is my understanding of the data model that these fields are an intrinsic part of every key and that they would always be defined.

Defining them as optional makes the client code more complex, because either a developer has to override the type hint or would have to write conditional code to handle the null situation.

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