Skip to content
Get started

Generate config suggestions

client.projects.configs.guess(ConfigGuessParams { project, spec, branch } params, RequestOptionsoptions?): ConfigGuessResponse { content }
post/v0/projects/{project}/configs/guess
Generate suggestions for changes to config files based on an OpenAPI spec.
ParametersExpand Collapse
params: ConfigGuessParams { project, spec, branch }
project?: string

Path param:

spec: string

Body param: OpenAPI spec

branch?: string

Body param: Branch name

ReturnsExpand Collapse
ConfigGuessResponse = Record<string, item>

Config files contents

content: string

The file content

Generate config suggestions
IMPORT STAINLESS FROM '@STAINLESS-API/SDK';

CONST CLIENT = NEW STAINLESS({
  APIKEY: 'MY API KEY',
});

CONST RESPONSE = AWAIT CLIENT.PROJECTS.CONFIGS.GUESS({ PROJECT: 'PROJECT', SPEC: 'SPEC' });

CONSOLE.LOG(RESPONSE);
{
  "foo": {
    "content": "content"
  }
}
Returns Examples
{
  "foo": {
    "content": "content"
  }
}