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

Is isJsonMime required in the Configuration object? #53

Closed
stevenwchien opened this issue May 20, 2024 · 2 comments
Closed

Is isJsonMime required in the Configuration object? #53

stevenwchien opened this issue May 20, 2024 · 2 comments

Comments

@stevenwchien
Copy link

The isJsonMime function isn't found in your API documentation anywhere. However, I'm finding that it is a required field in the Configuration type. When trying to build a Configuration object like so:

    const tremendousConfiguration: TremendousConfiguration = {
        basePath: TremendousEnvironment.production,
        accessToken: TREMENDOUS_API_KEY,
    };

I am presented with the following Typescript error:
tremendous_api_type_error

Peering into configuration.d.ts that comes with the package, I see:

export declare class Configuration {
    /**
     * parameter for apiKey security
     * @param name security name
     * @memberof Configuration
     */
    apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);

    ....

    constructor(param?: ConfigurationParameters);
    /**
     * Check if the given MIME is a JSON MIME.
     * JSON MIME examples:
     *   application/json
     *   application/json; charset=UTF8
     *   APPLICATION/JSON
     *   application/vnd.company+json
     * @param mime - MIME (Multipurpose Internet Mail Extensions)
     * @return True if the given MIME is JSON, false otherwise.
     */
    isJsonMime(mime: string): boolean;
}

Wondering if this may have slipped into the OpenAPI spec generation by accident. Or if it is required, could you please add it to your documentation?

Thanks,
Steven Chien

@lucasmazza
Copy link
Contributor

Hey @stevenwchien, have you tried building the config object using its constructor? That's the recommended way to initialize it before making requests with this SDK.

const tremendousConfiguration = new Configuration({
  basePath: TremendousEnvironment.production,
  accessToken: TREMENDOUS_API_KEY,
});

@stevenwchien
Copy link
Author

@lucasmazza Thanks for the clarification. That works! I missed that in the docs

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

2 participants