containers/podman

libpod Swagger spec has multiple fields with same x-go-name

Open

#22.966 geöffnet am 11. Juni 2024

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (3.107 Forks)batch import
ContribfestGood First Issuedocumentationkind/bugvolunteers-wanted

Repository-Metriken

Stars
 (31.686 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Issue Description

If you download the libpod Swagger spec from https://storage.googleapis.com/libpod-master-releases/swagger-v5.1.1.yaml and look at ManifestAddArtifactOptions, both annotations and artifact_annotations use the same x-go-name. I ran into this while attempting to generate a Go HTTP-based client for an environment where the dependencies for the Go bindings are not available.

Steps to reproduce the issue

Steps to reproduce the issue

  1. mkdir test
  2. cd test
  3. go mod init example.com/m
  4. go get github.com/go-swagger/go-swagger/cmd/swagger
  5. curl -sfL https://storage.googleapis.com/libpod-master-releases/swagger-v5.1.1.yaml -o swagger.yaml
  6. go run github.com/go-swagger/go-swagger/cmd/swagger generate client --name='Podman API' --spec=swagger.yaml
  7. go mod tidy
  8. go vet ./models

Describe the results you received

go vet encounters an error because the same field is declared multiple times:

$ go vet ./models
# example.com/m/models
vet: models/manifest_add_artifact_options.go:28:2: Annotations redeclared

Describe the results you expected

The swagger spec should describe valid Go types and client.

podman info output

N/A

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

No

Additional environment details

No response

Additional information

No response

Contributor Guide