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

Support application/fhir+json as a json mimetype #3343

Closed
1 task
orlandow opened this issue Oct 25, 2024 · 2 comments · Fixed by #3355
Closed
1 task

Support application/fhir+json as a json mimetype #3343

orlandow opened this issue Oct 25, 2024 · 2 comments · Fixed by #3355
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@orlandow
Copy link

Problem to solve

Similar to #1766

The formal mimetype for FHIR resources as JSON is application/fhir+json.

Proposal

Add application/problem+json to the list of mimetypes that can be decoded as text.

Additional context and resources

https://www.iana.org/assignments/media-types/application/fhir+json

Tasks to complete

  • Add application/fhir+json to the list of mimetypes that can be interpreted as json
@orlandow orlandow added the enhancement New feature or request label Oct 25, 2024
@jcamiel jcamiel added this to the 6.0.0 milestone Oct 25, 2024
@jcamiel jcamiel added the good first issue Good for newcomers label Oct 28, 2024
@jcamiel
Copy link
Collaborator

jcamiel commented Oct 28, 2024

@fabricereix @lepapareil currently we have a white list of "textable" mimetype

pub fn is_kind_of_text(content_type: &str) -> bool {
let content_types = [
"text/",
"application/json",
"application/problem+json", // See https://datatracker.ietf.org/doc/html/rfc7807
"application/xml",
"application/x-www-form-urlencoded",
];
content_types.iter().any(|c| content_type.contains(c))
}

Maybe we could add a wildcard for application+*.json, I see that there is a lot of them defined here https://www.iana.org/assignments/media-types/media-types.xhtml#application:

  • application/ace+json
  • application/calendar+json
  • application/city+json
  • application/dns+json
  • etc....

We could alos do the same for application+*.xml:

  • application/atom+xml
  • application/calendar+xml
  • application/clue+xml
  • etc...

@jcamiel
Copy link
Collaborator

jcamiel commented Oct 30, 2024

@orlandow That's done, it will be available on the next Hurl version 6.0.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants