OpenAPITools / OpenAPITools/openapi-generator
[REQ] [typescript] Allow ParameterizedServer servers for typescript-node
Nobody has claimed this yet.
- 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.
Currently OAS 3 and some of its generators in this repo support ParameterizedServer which allows a server to be designed as follows:
servers:
- url: https://{environment}.example.com/v2
variables:
environment:
default: api # Production server
enum:
- api # Production server
- api.dev # Development server
- api.staging # Staging server
This feature is to track adding in the usage of parameterized servers in typescript-node.
Describe the solution you'd like
This is likely possible by:
- Adding a configuration object which is sent to the
constructorof the API - The configuration object will refer to the servers variables as
enumsand reconstruct the URL using the variables passed in.
If multiple servers are found, a warning can be logged.
Describe alternatives you've considered
Open for intepretation
Additional context
Would like advice on the best way to look into this since typescript-node still uses basePath which would likely have to be overwritten.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the typescript-node generator's handling of the API constructor and basePath, then compare how other generators support ParameterizedServer. Define how constructor configuration supplies server variables and how the URL is reconstructed; done should include the selected server behavior and a warning when multiple servers are present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100