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

Register JSON API mimetype for JSON lexer #259

Merged
merged 1 commit into from
May 19, 2015
Merged

Register JSON API mimetype for JSON lexer #259

merged 1 commit into from
May 19, 2015

Conversation

brettchalupa
Copy link
Contributor

JSON API is a standard for building APIs in JSON. It is registered with the
IANA as application/vnd.api+json -
http://www.iana.org/assignments/media-types/application/vnd.api+json

This adds support for highlighting JSON API media types as JSON.

JSON API is a standard for building APIs in JSON. It registered with the
IANA as application/vnd.api+json -
http://www.iana.org/assignments/media-types/application/vnd.api+json

This adds support for highlighting JSON API media types as JSON.
@thibaudgg
Copy link

👍

@@ -206,7 +206,7 @@ class JSON < RegexLexer
desc "JavaScript Object Notation (json.org)"
tag 'json'
filenames '*.json'
mimetypes 'application/json'
mimetypes 'application/json', 'application/vnd.api+json'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps application/(.*)+json could match?

This way other JSON based hypermedia types will be included:

  • application/json
  • application/hal+json
  • application/vnd.siren+json
  • application/vnd.api+json

There is another PR adding HAL #250 too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylef good idea - I will do some exploring to see what it would look like to support a * for the different extensions.

@jneen
Copy link
Member

jneen commented May 19, 2015

Thanks!

jneen added a commit that referenced this pull request May 19, 2015
Register JSON API mimetype for JSON lexer
@jneen jneen merged commit a8a81b7 into rouge-ruby:master May 19, 2015
@brettchalupa brettchalupa deleted the json-api-mime-type branch May 19, 2015 15:38
lucidbee pushed a commit to BonsaiAI/rouge that referenced this pull request Mar 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants