Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Commit

Permalink
Add .haljson extension support
Browse files Browse the repository at this point in the history
  • Loading branch information
danbarua committed Aug 24, 2016
1 parent 3569165 commit f89ab78
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Nancy.Hal/Processors/HalJsonResponseProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ namespace Nancy.Hal.Processors
{
public class HalJsonResponseProcessor : IResponseProcessor
{
private static readonly IEnumerable<Tuple<string, MediaRange>> extensionMappings =
new[] { new Tuple<string, MediaRange>("haljson", new MediaRange("application/hal+json")) };

private const string ContentType = "application/hal+json";
private readonly IProvideHalTypeConfiguration configuration;
private readonly ISerializer serializer;



public HalJsonResponseProcessor(IProvideHalTypeConfiguration configuration, IEnumerable<ISerializer> serializers)
{
this.configuration = configuration;
Expand Down Expand Up @@ -99,6 +104,12 @@ private static dynamic BuildDynamicLink(Link link)
return dynamicLink;
}

public IEnumerable<Tuple<string, MediaRange>> ExtensionMappings { get { return Enumerable.Empty <Tuple<string, MediaRange>>(); } }
public IEnumerable<Tuple<string, MediaRange>> ExtensionMappings
{
get
{
return extensionMappings;
}
}
}
}

0 comments on commit f89ab78

Please sign in to comment.