OpenAPITools / OpenAPITools/openapi-generator

[REQ] [GO] Split request population from response handling

Open
#14,521 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Could the api function https://github.com/OpenAPITools/openapi-generator/blob/5047273f1e02eaf42944f92fcaaffb5a1577e75c/modules/openapi-generator/src/main/resources/go/api.mustache#L111 be split into two functions one for the request population and one for the response handling : i.e. one function for everything above https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/go/api.mustache#L340 and one for the rest.

This would mean we could add additional HTTP headers to the request if we need to or be a bit more granular about how the request is formed (e.g. for testing purposes). We could also test more easily the response handling.

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 modules/openapi-generator/src/main/resources/go/api.mustache, especially the request-handling section around line 111 and the response-handling boundary around line 340. Review how this template produces Go API client methods; done means request population and response handling are separated so callers can add headers or test response handling independently.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.