danielgtaylor / danielgtaylor/openapi-cli-generator
Getting Started Issues
- Vorherrschende Sprache
- Go
- Sterne
- 218
- Forks
- 54
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I want to build a cli from my company's api and I'm trying to get started with the openapi-cli-generator https://github.com/danielgtaylor/openapi-cli-generator but I'm running into some different errors.
I took the petstore demo api https://petstore.swagger.io/v2/swagger.json removed the top of the file comments and converted it to yaml using https://www.json2yaml.com/ then following the steps on the openapi-cli-generator github page, I run openapi-cli-generator generate petstore.yaml
and I get this type of error: Failed to resolve '#/definitions/Pet' in fragment in URI: 'definitions': Struct field not found: definitions which is complaining about lines like schema: "$ref": "#/definitions/Pet" in the yaml file. I tried replacing the $ref values with '' ex "$ref":"" and now I can run openapi-cli-generator generate petstore.yaml Was relacing the ref values with empty string the right thing to do? What is the nature of the problem.
Next, the git hub instructions say to add a line like openapiRegister(false) what is this supposed to do exactly? What does it mean to register a command? Are these the commands that will be part of the cli? What does the syntax look like? The github page doesn't give any examples
Is there supposed to be a one cli command per api call in the generated cli?
petstore-cli PetstoreFindPetsByStatus --help - unknown command "PetstoreFindPetsByStatus" for "petstore-cli.exe" (I need to register the command that I want?)
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Reproduzieren Sie den gemeldeten Lauf `openapi-cli-generator generate petstore.yaml` mit dem Petstore-Swagger-Dokument und vergleichen Sie ihn anschließend mit der dokumentierten OpenAPI-Unterstützung des Generators. Verfolgen Sie dann `openapiRegister(false)` und die generierten Command-Einstiegspunkte, um zu bestimmen, wie Commands registriert werden und welche Commands erzeugt werden sollten. Als erledigt gilt die Aufgabe, wenn der `$ref`-Fehler, die Registrierungssyntax und die erwarteten generierten CLI-Commands mit funktionierenden Beispielen dokumentiert sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- go, openapi
- Bereich
- cli, documentation
- Issue-Typ
- Dokumentation
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 20/100