Why is there an output but no input in the configuration schema? #2196
-
|
I love the tool but one thing which I simply don't understand is why can you specify the output in the config but not the input? I try to establish an API-first approach in our projects. For this purpose, I want the code generation to be as simple as possible. # yaml-language-server: $schema=https://raw.githubusercontent.com/oapi-codegen/oapi-codegen/HEAD/configuration-schema.json
package: api
output: ../../../services/maconomy/maconomy_client.gen.go
generate:
models: true
client: true
embedded-spec: trueAs there is an So instead of running: I need to run: And when I want to run the generation from within a parent directory, I have to update both the path to the config.yaml and to the open-api.yaml. It's just an inconvenience and not a blocker but it surprises me and I couldn't find anything about this in the docu. Maybe I am missing something and there is a good reason for this decision? I would like to understand this. Any help is much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
There's no particular reason, it's just how the code evolved to this point. It'd be easy to support. Want to send us a PR? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the fast replay. That makes sense.
Thanks for the invite! I’d definitely be interested, but at the moment I’m focused on other work. I might be able to look into it in the future, though I unfortunately can’t make any promises at this point. |
Beta Was this translation helpful? Give feedback.
There's no particular reason, it's just how the code evolved to this point. It'd be easy to support. Want to send us a PR?