oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

Generate path as constant string

Open zhoub opened this issue 3 years ago • 2 comments

For example,

	r.Group(func(r chi.Router) {
		r.Get(options.BaseURL+"/something", wrapper.CreateSomething)
	})

it would be great to make the string /something become public constant, as enum string, so that the other code could use this constant path directly.

zhoub avatar Nov 11 '22 07:11 zhoub

Out of interest, what code would you find this useful to use this?

jamietanna avatar Nov 12 '22 20:11 jamietanna

When the specification has to be parsed and to processed, the path becomes a key-like, that would be a unified way of access instead of literal string.

zhoub avatar Nov 13 '22 11:11 zhoub