OpenAPITools / OpenAPITools/openapi-generator

[REQ] Make server port a command-line option

Open
#8,009 0 comments 0 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

Is your feature request related to a problem? Please describe.

Problem: port is hardcoded, but often, you want your server to run on a different port without having to recompile from code

Describe the solution you'd like

add a command-line option to run server on a user-specified port

for example, to run on 8081:
myserver -p 8081

Note: I only need this solution (for now) implemented in go-server.

Describe alternatives you've considered

Using the serverPort configuration option still hardcodes the port and once the binary is created, the port cannot be changed without recompilation

Additional context

Am happy to make this change, for go-server only, and create a pull request if you can give an indication that it would be taken

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 locating the go-server command-line entry point and the code that currently uses the hardcoded server port. Check how the existing serverPort configuration is handled and find the relevant go-server tests, if present. Done means the generated server can accept a user-specified port such as 8081 through -p without recompilation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.