swagger-api / swagger-api/swagger-codegen

[cpprest] Example of using the cpprest client library code?

Open
#8,035 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I've recently started using swagger-codegen to generate the cpprest client code for my swagger spec. The code all compiles and links swell in my C++ app.

But, how do I actually use it from my C++ application? I've seem to have initialized the ApiClient and ApiConfiguration. But it's not clear to me how to incorporate the getXXX() call on my API object (ex: DefaultApi).

I've done a rather extensive internet search for source code demonstrating using the generated client code, but to no avail. I've also noted there is the swagger-codegen sample petstore client library for cpprest at tree/master/samples/client/petstore/cpprest but is there a test harness for it anywhere? Am I missing something obvious? (Be kind, I'm new to swagger/cpprest)

Swagger-codegen version

2.3.1

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 samples/client/petstore/cpprest and inspect whether it demonstrates initializing ApiClient and ApiConfiguration before calling DefaultApi methods. Check whether a test harness exists for that sample; done would be a clear, runnable example showing how a generated cpprest client is used from a C++ application.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.