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

OpenAPI v3 support #179

Open
2 tasks done
thiagoarrais opened this issue Nov 1, 2019 · 6 comments
Open
2 tasks done

OpenAPI v3 support #179

thiagoarrais opened this issue Nov 1, 2019 · 6 comments

Comments

@thiagoarrais
Copy link

thiagoarrais commented Nov 1, 2019

Are there any plans for supporting OpenAPI v3?

Here's what I'm getting when I do terraform plan with a v3 spec:

[DEBUG] plugin.terraform-provider-openapi_v0.22.2:
  2019/11/01 11:00:00 [ERROR] There was an error initialising the terraform provider:
  plugin terraform-provider-openapi init error while creating schema provider: swagger
  version '' not supported, specV2BackendConfiguration only supports 2.0

Checklist

Don't forget to go through the checklist to make sure the issue is created properly:

  • I have added a corresponding label (feature request/bug/etc) to the issue (right side menu)
  • I have added this issue to the 'API Terraform Provider' GitHub project (right side menu)
@thiagoarrais
Copy link
Author

P.S.: Can't actually add label nor assign projects because they're not public.

@dikhan
Copy link
Owner

dikhan commented Nov 4, 2019

Hi @thiagoarrais ,

Thanks for opening the issue. Yes, there's plans on supporting OpenAPI 3.0 and we are hoping to start working on that soon. Unfortunately, I can't really provide an actual timeline at the moment as there's other priorities in the pipe that need to be addressed first.

Nevertheless, the code is already prepared to support new OpenAPI versions implementations as shown below and I would be happy to collaborate on that if you are interested:
https://github.com/dikhan/terraform-provider-openapi/blob/master/openapi/openapi_spec_analyser.go#L48.

Always happy to accept new PRs.

P.S: Thanks for letting me know about the project/labels. Will update the PR checklist accordingly and update the issue the label and project.

@codyaray
Copy link

Any updates on this? Trying to decide where we go from here. We're all invested in openapi 3.0 but want a dynamic provider such as this

@davidfischer-ch
Copy link

Hello, any updates on this? How difficult it would be to build an analyzer for V 3.0? Thank you.

@dikhan
Copy link
Owner

dikhan commented Dec 24, 2021

Hi folks, thanks for your feedback and your interest in the OpenAPI Terraform provider - and apologies for the slow response here (recently had a baby so my time has been pretty limited the past few months).

For the sake of more context, the main blocker for this feature request work has been the lack of support for Go libraries that serialize and deserialize OpenAPI 3.0 specs. Currently, the OpenAPI Terraform provider makes use of the go-swagger to serialize/deserialize OpenAPI 2.0 documents, unfortunately the go-swagger main contributors have stated that they won’t be supporting OpenAPIv3. Having said that, looks like there’s few alternatives in the open source community that could be used instead.

My plan is to start adding support for OpenAPI 3.0 in the upcoming year (time permitting), and the initial tentative rough roadmap includes the following:

  • Find a good supported Go library that enables loading of OpenAPI v3 documents from local and remote locations (supporting marshalling/un-marshalling of JSON/YAML documents). Bonus if it can auto expand the $refs in the document for simpler processing of the model object.
  • The OpenAPI 3.0 spec introduces major interface and behaviour changes compare to OpenAPI 2.0 that the OpenAPI Terraform provider may not be compatible for with the current design (eg: multiple servers, components, security definitions, etc). Hence, it might be worth spending some time understanding such differences and how those will be translated in the corresponding SpecAnalyser implementation.
    • As part of that, adding support to the most basic use case supported today in v2 that detects if a resource is OpenAPI Terraform compliant and if so registers it in the provider dynamically.
  • Figure out a strategy on how to maintain two tracks of work (if deemed needed) one oriented to what's currently being supported and be able to continue add improvements and bug fixes and another one focused on the v3SpecAnalyzer and corresponding changes (potentially breaking changes if needed to improve the overall plugin architecture) without coupling the releases. The Terraform SDK repo for instance uses main for the most recent supported functionality (github.com/hashicorp/terraform-plugin-sdk/v2) and a separate branch v1-maint that they continue to contribute to for the first version of the SDK (github.com/hashicorp/terraform-plugin-sdk). This is not blocking for now, but something to keep in mind once things start getting into motion.

To make it easier for the community to contribute to this endeavour, I am thinking of creating a dedicated readme with the different features needed to support the OpenAPI 3.0 version with linked stories to the OpenAPI 3.0 project. I am hoping to start putting together some initial cards early in Jan.

Hope this sheds some light into the plan to support OpenAPI 3.0 (which is something I am pretty excited about!)

And of course, any help would be more than welcomed!

Thanks,
Dani

@joerg
Copy link

joerg commented Nov 15, 2022

@dikhan There has been a v3 release in April but this is not to confuse with OpenAPI v3 support of this issue, is it? I've been playing around with this project a few hours now, but I guess my issues all come down to the missing OpenAPI v3 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants