Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add media type utilities #296

Closed
sleberknight opened this issue Jul 21, 2023 · 0 comments · Fixed by #297
Closed

Add media type utilities #296

sleberknight opened this issue Jul 21, 2023 · 0 comments · Fixed by #297
Assignees
Labels
new feature A new feature such as a new class, method, package, group of classes, etc.
Milestone

Comments

@sleberknight
Copy link
Owner

Add a new utility for working with media types.

They should work with either strings or JAX-RS/Jakarta-RS MediaType. This means they do not require use of JAX-RS/Jakarta-RS.

See Consider adding new KiwiMediaTypes utility class in kiwi.

@sleberknight sleberknight added the new feature A new feature such as a new class, method, package, group of classes, etc. label Jul 21, 2023
@sleberknight sleberknight added this to the 0.5.0 milestone Jul 21, 2023
@sleberknight sleberknight self-assigned this Jul 21, 2023
sleberknight added a commit that referenced this issue Jul 21, 2023
* Add KiwiMediaTypes utility class
* Add jakarta.ws.rs-api as a provided dependency so that
  it is not a required transitive dependency. Only if callers
  use the methods that accept Jakarta RS MediaType will
  that dependency be needed. If they are only using Strings
  then the only dependency is Guava, which is already required.
* For the tests to use the Jakarta RS MediaType#valueOf method
  I needed to add jersey-common as a test-scope dependency
  because valueOf internally requires an implementation

Closes #296
dsingley pushed a commit that referenced this issue Jul 25, 2023
* Add media type utilities

* Add KiwiMediaTypes utility class
* Add jakarta.ws.rs-api as a provided dependency so that
  it is not a required transitive dependency. Only if callers
  use the methods that accept Jakarta RS MediaType will
  that dependency be needed. If they are only using Strings
  then the only dependency is Guava, which is already required.
* For the tests to use the Jakarta RS MediaType#valueOf method
  I needed to add jersey-common as a test-scope dependency
  because valueOf internally requires an implementation

Closes #296

* Remove the implementation note from isXml and isJson docs

We only need it on toStringWithOnlyTypeAndSubtype

* Rename private method and make public

Rename toStringWithOnlyTypeAndSubtype to toStringWithoutParameters
and make it public.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature A new feature such as a new class, method, package, group of classes, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant