-
Notifications
You must be signed in to change notification settings - Fork 14
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
Allow definition of additional attributes in generator configuration #86
Comments
Hi @AgustinBettati 👋 Thank you for raising this, its an interesting use case that we would love to hear more about.
Can you describe this scenario a little more? For example, is this endpoint also defined via OpenAPI? Is there a particular reason why the API models this information separately or, flipping the question around, is there a particular reason why the Terraform resource models this information from multiple API endpoints rather than separately? I think we should be conscious in this project to make sure we're not trying to solve all possible generic specification or code generation use cases here, where a solution may potentially make more sense elsewhere (that might not exist yet). To describe what I mean a little more, if this is use case is not modeled well by OpenAPI alone, there feels like an opportunity to introduce tooling, etc. that is specifically meant for adding/overriding content in an existing specification. Thanks! |
We had cases were certain functionality highly related to an existing resource was exposed in different endpoint and we decided to incorporate the feature as a new attribute over defining a new resource all together. This was mainly in terms of improving usability for the end user. I would also keep in mind the case of the
It would seem logical that the configuration file focuses on providing information that complements the API Spec with terraform specific information or overrides (such as the description). Given that some properties may not be present in the API Spec, defining these additions in the generation configuration seems like an intuitive place. |
Thanks for submitting this @AgustinBettati, this is an interesting proposal that, as Brian mentioned, not only applies to The general problem sounds like we need to have a good way to add/modify a provider code spec when a generator either:
Since this problem will likely exist in every provider spec generator in some form, we're going to do some discovery on if we can solve this problem more generally, rather then updating the generator config in the OpenAPI generator right now. I'm going to keep this issue open for convenience of discussing/tracking this functionality. If you have more use-cases that fit into this "slight modifications, additions, deletions" that are unrelated to an OpenAPI spec, please share! |
Hi @austinvalle. Just wanted to share an additional use case I encountered which is the use of the timeouts attribute, this is also a terraform specific concept that will not be present in the OpenAPI Spec. |
Running into a related situation where I want to add a |
Context
I am facing a scenario in which I have a terraform schema which in majority conforms with the schema defined in the API Spec, but terraform defines additional attributes which are populated using an unrelated endpoint.
Enhancement request
For these cases, it would be useful to give users flexibility in the generator configuration to define any additional attributes that are needed to define the complete schema of the resource.
As a proposal, the
attributes
object could define a new field for defining new properties and require the user to provide the attribute definition using the provider code specification. Example:Edit from @austinvalle
Bringing over some information from #84 that would also fit in this request:
Also some from #85:
The text was updated successfully, but these errors were encountered: