swagger-api / swagger-api/swagger-codegen

[Swift4] OpenAPI V3.0 - Server Tags convert into injectable objects?

Open
#6,802 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Swift General: Suggestion
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

This may be an enhancement request for when you have a capability to codegen v3.0 of the Swagger specs.

In V3.0 there is a servers tag where we can specify multiple servers eg production, staging, development. If these can be converted into injectable objects, then we can use it to instantiate requests to appropriate base paths depending on the destination.

Currently, the Open API specs just gives a URL and a description tags for each of the server. Neither can be used to create a name for the object. So may need to work with OpenAPi to add a 'name' tag? Or if you can come up with another way?

Swagger-codegen version

NA

Swagger declaration file content or url

NA

Command line used for generation

NA

Steps to reproduce

NA

Related issues/PRs

NA

Suggest a fix/enhancement

NA

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 at the Swift4 code-generation entry point for OpenAPI v3.0 server tags and trace how each server URL and description are currently handled. Define how servers should be named and injected, then verify that generated requests can select the intended production, staging, or development base path.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, swift
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.