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

Docs not updated to show change to config file #1282

Open
immesys opened this issue Jul 23, 2024 · 2 comments
Open

Docs not updated to show change to config file #1282

immesys opened this issue Jul 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@immesys
Copy link

immesys commented Jul 23, 2024

What version of ogen are you using?

1.2.2

Can this issue be reproduced with the latest version?

Yes

What did you do?

The docs say I can use --convenient-errors=on (which I was using in older versions) but this doesn't work against the latest. Doing a git bisect it seems like there is now a config file, but the docs don't mention that.

@immesys immesys added the bug Something isn't working label Jul 23, 2024
@volkerhess2
Copy link

You can create a yaml file with

generator:
 convenient_errors: false

and use it with the config flag: --config=myconfig.yaml

@abemedia
Copy link
Contributor

abemedia commented Oct 4, 2024

I agree it would be great to have a page dedicated to the config file on the docs. I ended up looking at the ogen code to figure out the possible config values:

ogen/gen/options.go

Lines 153 to 175 in 4182357

type GenerateOptions struct {
// Features sets generator features.
Features *FeatureOptions `json:"features" yaml:"features"`
// Filters contains filters to skip operations.
Filters Filters `json:"filters" yaml:"filters"`
// IgnoreNotImplemented contains ErrNotImplemented messages to ignore.
IgnoreNotImplemented []string `json:"ignore_not_implemented" yaml:"ignore_not_implemented"`
// NotImplementedHook is hook for ErrNotImplemented errors.
NotImplementedHook func(name string, err error) `json:"-" yaml:"-"`
// ConvenientErrors control Convenient Errors feature.
//
// Default value is `auto` (0), NewError handler will be generated if possible.
//
// If value > 0 forces feature. An error will be returned if generator is unable to find common error pattern.
//
// If value < 0 disables feature entirely.
ConvenientErrors ConvenientErrors `json:"convenient_errors" yaml:"convenient_errors"`
// ContentTypeAliases contains content type aliases.
ContentTypeAliases ContentTypeAliases `json:"content_type_aliases" yaml:"content_type_aliases"`
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants