riskfirst / riskfirst.hateoas

Powerful HATEOAS functionality for .NET web api
MIT License
78 stars 25 forks source link

Property name, "_links" verus "links". Configurable? #15

Closed rebeccapowell closed 6 years ago

rebeccapowell commented 6 years ago

It seems that HATEOAS has no defined preference for the use of "links" or "_links". Some libraries use one or the other.

As part of our API definition, we have published the contracts using "links" but this library uses "_lnks" as the property name. I don't really want to change the contract since customer have already started building clients against that published contract.

Is there any way to configure this property name?

jamiecoh commented 6 years ago

Hi,

Our default implementation has a base model class implementing ILinkContainer which does indeed hard-code the property to _links.

There is nothing stopping you having your own base model which implements ILinkContainer but uses whatever property you like. Or you can just implement ILinkContainer in your existing model(s).

Let me know if you have any further questions.

Regards

Jamie