dikhan / terraform-provider-openapi

OpenAPI Terraform Provider that configures itself at runtime with the resources exposed by the service provider (defined in a swagger file)
Apache License 2.0
273 stars 49 forks source link

Support nexus default spec #207

Open juliostanley opened 4 years ago

juliostanley commented 4 years ago

First, this looks great. Thanks for making it.

Is your feature request related to a problem?

I attempted to use a Nexus OSS spec, but was unable to do so for a couple of reasons

Example:

As an OpenAPI Terraform User
I want to point to a nexus swagger spec (i.e. https://nexus3.onap.org/service/rest/swagger.json)
So that it can be managed using this provider without downloading spec and manual modifications

Describe the solution you'd like

Acceptance criteria

Ideally it should be possible to point to a nexus swagger.json and just have it work

Example:

Scenario: As an OpenAPI Terraform User
Given A swagger-url https://nexus3.onap.org/service/rest/swagger.json
When data "nexus_repositories_v1" "maven" { name= "maven-public" }
Then data.maven.name is available

Describe alternatives you've considered

None really, just a quick thought from my initial usage/attempt

Does terraform filter apply for get requests on this provider? Is the issue that only {id} or {x-terraform-id} is supported?

data "nexus_repositories_v1" "mvn" {
  filter {
    name = "name"
    values = ["maven-public"]
  }
}

Additional context

Trying to do this with a docker container: docker run --rm -it 8081:8081 sonatype/nexus3:3.21.1

Checklist (for admin only)

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

dikhan commented 4 years ago

Hi @juliostanley , thanks for raising the issue and documenting it so well! I am currently on a trip with no access to my laptop and won’t be able to look into this until later in March. The points raised though seem doable and reasonable so if you would like to take a crack at it pls feel free to do so. I’ll be happy to review the changes and pair if needed.

Answering some of the bullets below:

Hope the info above helps.

Dani