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

Unexpected response type for the createKey operation #9

Open
CarstenLeue opened this issue Nov 29, 2021 · 0 comments
Open

Unexpected response type for the createKey operation #9

CarstenLeue opened this issue Nov 29, 2021 · 0 comments

Comments

@CarstenLeue
Copy link

The createKey operation is declared as follows:

createKey(params: IbmKeyProtectApiV2.CreateKeyParams): Promise<IbmKeyProtectApiV2.Response<IbmKeyProtectApiV2.Key>>;

with IbmKeyProtectApiV2.Response as

    interface Response<T = any> {
        result: T;
        status: number;
        statusText: string;
        headers: IncomingHttpHeaders;
    }

and IbmKeyProtectApiV2.Key:

        /** The metadata that describes the resource array. */
        metadata?: CollectionMetadata;
        /** A collection of resources. */
        resources?: KeyWithPayload[];

Why are metadata and resources optional if the API returns successfully? In that case a key has been created and the data structures need to be defined. Under what circumstances would they be undefined?

In case the API does not handle errors on the exception channel of the promise, then the result field on Response should be optional rather than the fields inside the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant