Skip to content
FeedbackDashboard

Generate config suggestions

client.Projects.Configs.Guess(ctx, params) (*ProjectConfigGuessResponse, error)
post/v0/projects/{project}/configs/guess
Generate suggestions for changes to config files based on an OpenAPI spec.
ParametersExpand Collapse
params ProjectConfigGuessParams
Project param.Field[string]optional

Path param:

Spec param.Field[string]

Body param: OpenAPI spec

Branch param.Field[string]optional

Body param: Branch name

ReturnsExpand Collapse
type ProjectConfigGuessResponse map[string, ProjectConfigGuessResponseItem]

Config files contents

Content string

The file content

Generate config suggestions
package main

import (
  "context"
  "fmt"

  "github.com/stainless-api/stainless-api-go"
  "github.com/stainless-api/stainless-api-go/option"
)

func main() {
  client := stainless.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.Projects.Configs.Guess(context.TODO(), stainless.ProjectConfigGuessParams{
    Project: stainless.String("project"),
    Spec: "spec",
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
{
  "foo": {
    "content": "content"
  }
}
Returns Examples
{
  "foo": {
    "content": "content"
  }
}