OpenAPITools / OpenAPITools/openapi-generator

[REQ] Help with the "frontend part"

Open
#7,365 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature Server: C++
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

I am part of a team in this moment.
Normally I work on frontend, but it happened there is no other who can do the Typescript part either than me.
I was given the task to build the client and the APIs.
I tried with your documentation and bought and read the book 'A Beginner's Guide to Code Generation for REST APIs (OpenAPI Generator).pdf', but unsuccessfully.
A colleague of mine did the C++part executing:
/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java -jar /home/.../openapitools/openapi-generator-cli/5.0.0-beta2/openapi-generator-cli-5.0.0-beta2.jar generate -i ./petstore.yaml -g cpp-restbed-server -o ./api

and obtained this folders:
find api/
api/
api/.gitignore
api/.openapi-generator-ignore
api/git_push.sh
api/api
api/api/UserApi.h
api/api/PetApi.h
api/api/StoreApi.cpp
api/api/PetApi.cpp
api/api/StoreApi.h
api/api/UserApi.cpp
api/README.md
api/.openapi-generator
api/.openapi-generator/FILES
api/.openapi-generator/VERSION
api/model
api/model/Category.cpp
api/model/ApiResponse.cpp
api/model/Pet.h
api/model/ApiResponse.h
api/model/Category.h
api/model/Order.h
api/model/Tag.h
api/model/User.h
api/model/Tag.cpp
api/model/Order.cpp
api/model/Pet.cpp
api/model/User.cpp

What should I do to continue the task with my part in Typescript?
What are the istructions to generate the remaining code to request APIs?
I didn't understand from the book.
I am working on a Linux machine.
Let me know, please.

logs for the C++ part:
/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java -jar /home/../.m2/repository/org/openapitools/openapi-generator-cli/5.0.0-beta2/openapi-generator-cli-5.0.0-beta2.jar generate -i ./petstore.yaml -g cpp-restbed-server -o ./api
[main] INFO o.o.codegen.DefaultGenerator - Generating with dryRun=false
[main] INFO o.o.codegen.DefaultGenerator - OpenAPI Generator: cpp-restbed-server (server)
[main] INFO o.o.codegen.DefaultGenerator - Generator 'cpp-restbed-server' is considered stable.
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] INFO o.o.c.languages.AbstractCppCodegen - Environment variable CPP_POST_PROCESS_FILE not defined so the C++ code may not be properly formatted. To define it, try 'export CPP_POST_PROCESS_FILE="/usr/local/bin/clang-format -i"' (Linux/Mac)
[main] INFO o.o.c.languages.AbstractCppCodegen - NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to true (--enable-post-process-file for CLI).
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/ApiResponse.h
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/ApiResponse.cpp
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/Category.h
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/Category.cpp
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/Order.h
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/Order.cpp
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/Pet.h
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/Pet.cpp
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/Tag.h
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/Tag.cpp
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/User.h
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/model/User.cpp
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[main] WARN o.o.codegen.DefaultCodegen - Multiple MediaTypes found, using only the first one
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml)
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/api/PetApi.cpp
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/api/PetApi.h
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/api/StoreApi.cpp
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/api/StoreApi.h
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/api/UserApi.cpp
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/api/UserApi.h
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/.gitignore
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/git_push.sh
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/README.md
[main] INFO o.o.codegen.TemplateManager - Skipped /home/atlas/sources/test/./api/.openapi-generator-ignore (Skipped by supportingFiles options supplied by user.)
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/.openapi-generator/VERSION
[main] INFO o.o.codegen.TemplateManager - writing file /home/atlas/sources/test/./api/.openapi-generator/FILES

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the issue's ./petstore.yaml input, the Java CLI command, and the generated api/ directory; the payload names no repository source file or test. Reproduce the reported generation context and determine which TypeScript client target and options are intended. Done would be clear, project-specific instructions for generating and using the requested TypeScript API client.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
api, tooling
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.