postmanlabs / postmanlabs/postman-code-generators

add support for QCObjects

Open
#432 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

codegen feature new-language-support
Dominant language
JavaScript
Stars
1k
Forks
381
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
It is needed an OOP oriented client in JavaScript to call microservices in the front-end side as well as the backend without the need to refactor the code.

Describe the solution you'd like
QCObjects is supporting that by the use of a serviceLoader helper that is wrapping the caller in the front-end as well as the backend using the same code pattern.

Additional context
Below is a code example that is working in the browsers as well as in node environment:

Class('MyTestService',Service,{
    name:'myservice',
    external:true,
    cached:false,
    method:'GET',
    headers:{'Content-Type':'application/json'},
    url:'https://api.github.com/orgs/QuickCorp/repos',
    withCredentials:false,
    _new_:()=>{
      // service instantiated
    },
    done:()=>{
      // service loaded
    }
});
// creating the OOP service client instance and loading it with serviceLoader at once
var service = serviceLoader(New(MyTestService,{
  data:{param1:1}
})).then(
  (successfulResponse)=>{
    // This will show the service response as a plain text
    console.log(successfulResponse.service.template);
  },
  (failedResponse)=>{

  });

QCObjects is being used by thousands of companies around the world since a few months ago (see npm stats ) and has been featured by British Herald as today, the most advanced framework for modern software development

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 by reviewing the repository's existing code-generator structure and JavaScript or Node.js generator entry points, then compare their output with the QCObjects serviceLoader example in the issue. Done should mean the project can generate QCObjects-compatible client code for the described front-end and backend use cases, with the required scope and tests identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.