这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@GreyXor
Copy link

@GreyXor GreyXor commented Mar 17, 2023

Allow to use server variables like this
image

ref: https://swagger.io/docs/specification/api-host-and-base-path/

Example PoC usage

humaRouter.ServerLink("Example server", "{scheme}://{host}:{port}/api", map[string]huma.CaServerVariable{
	"scheme": {
		Enum:        []string{"http", "https"},
		Default:     "https",
		Description: "Example description 🔥",
	},
	"host": {
		Default:     "127.0.0.1",
		Description: "IP or domain where your server is located.",
	},
	"port": {
		Default:     "1337",
		Description: "Server port.",
	},
})

@GreyXor GreyXor closed this Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant