Effect-TS / effect

An ecosystem of tools to build robust applications in TypeScript
https://effect.website
MIT License
7.69k stars 244 forks source link

Platform: Add possibility to rename security identifier in the OpenApi #3965

Closed janydoe closed 2 days ago

janydoe commented 3 days ago

What is the problem this feature would solve?

now the open api displays the identifier that we specify as the key in security. and there is no way to rename it using the HttpApiSecurity.annotate or HttpApiSecurity.annotateContext.

What is the feature you are proposing to solve the problem?

Add the ability to change the identifier using the OpenApi.Identifier

What alternatives have you considered?

No response

KhraksMamtsov commented 2 days ago

Could you give me an example? Why is an identifier of the same name not enough?

janydoe commented 2 days ago

There are no problems specifically for the code, but in the documentation (swagger, redoc, scalar) I would like to rename these fields so that there is no camelCase and it is understandable for people. Now we can name the key as follows: ["Session Cookie"], but then it will not be convenient in the code.

KhraksMamtsov commented 2 days ago

This is invalid token according OpenAPI spec

image

but you can annotate it with OpenAPI.Description and get human readable description in UI ("Session Cookie description" line)

image
janydoe commented 2 days ago

I see. Thanks