jakartaee / rest

Jakarta RESTful Web Services
Other
361 stars 117 forks source link

Add application/yaml MediaType #1272

Open Pakisan opened 3 months ago

Pakisan commented 3 months ago

Hi!

I'm working on service, which is working with YAML, so I decided to propose to you to add application/yaml MediaType

RFC: https://www.rfc-editor.org/rfc/rfc9512.html#name-media-type-application-yaml IANA: https://www.iana.org/assignments/media-types/media-types.xhtml

jamezp commented 3 months ago

YAML is definitely being used more these days so I don't object to this if others are okay with it. That said, I don't think we need to add every media type. It's really simple to define your own that can be used in your own code.

Pakisan commented 3 months ago

That said, I don't think we need to add every media type. It's really simple to define your own that can be used in your own code.

Yep, agree with you.

I have next point:

Here is three well-known formats:

I'm sure that will be better add YAML, to receive it's support out of the box in frameworks, like Quarkus, for example and not to create and pack own-crafted MediaType

mkarg commented 3 months ago

Just adding a string constant does not make it supported "out of the box", as JAX-RS does not mandate any implementation to provide Entity Providers for YAML.

Pakisan commented 3 months ago

Just adding a string constant does not make it supported "out of the box", as JAX-RS does not mandate any implementation to provide Entity Providers for YAML.

No problem, I'm ready to implement it. Where to dig?

mkarg commented 3 months ago

Just adding a string constant does not make it supported "out of the box", as JAX-RS does not mandate any implementation to provide Entity Providers for YAML.

No problem, I'm ready to implement it. Where to dig?

In the repo of every vendor implementing JAX-RS, as here at JAX-RS we only provide interfaces. 😅

Pakisan commented 3 months ago

Just adding a string constant does not make it supported "out of the box", as JAX-RS does not mandate any implementation to provide Entity Providers for YAML.

No problem, I'm ready to implement it. Where to dig?

In the repo of every vendor implementing JAX-RS, as here at JAX-RS we only provide interfaces. 😅

Oookay, understood 😅

mkarg commented 3 months ago

No problem, I'm ready to implement it. Where to dig?

In the repo of every vendor implementing JAX-RS, as here at JAX-RS we only provide interfaces. 😅

Oookay, understood 😅

A good starting point is Jersey. For long time it was the Reference Implementation of JAX-RS, and still many people are using it.