microsoft / typespec

https://typespec.io/
MIT License
4.51k stars 218 forks source link

Missing decorators for OpenAPI3 emitter #3293

Open timotheeguerin opened 6 months ago

timotheeguerin commented 6 months ago

Clear and concise description of the problem

Arithmomaniac commented 2 months ago

Sefaria uses both title and uniqueItems; neither of them are deal-breakers for their use of tsp-openapi3, but it prevents porting with perfect fidelity.

timotheeguerin commented 2 months ago

title can be set with @summary, for uniqueItems there is no way around for now. The proposed plan was just to remove the x- resitrction on @extension to let any of those be specified without additional decorators

Arithmomaniac commented 2 months ago

Re @title: good to know, but is that documented anywhere? The proposed solution for uniqueItems doesn't provide value validation the way e.g. @minValue does.

timotheeguerin commented 2 months ago

Doesn't seem like it, and yeah that is unfortunate, the question was if we wanted to really add all those extra decorators only have the future openapi3.1 emitter that will use json schema decorators directly

Arithmomaniac commented 2 months ago

Is said future emitter even backlogged anywhere? I would have thought that since you have jsonshema decorators already, it wouldn't be too much work to just copy them over. But I don't know how much they vary internally.

timotheeguerin commented 2 months ago

https://github.com/microsoft/typespec/issues/1698 and yeah its probably not hard and we didn't make any hard descision on using @extension it was more as an escape hatch

wanlwanl commented 2 weeks ago

chrisradek is refactoring oas3 emitter to use json schema emitter, after that we can resue json schema's components to add these decorators easily