[[other-representations]]
= Other Representations

:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.



Sometimes though you may want to extend or change the representations generated.
This might be because you want to write a RESTful client that uses a particular library (say a JavaScript library or web components) that can only handle representations in a certain form.

Or, you might want to have Apache Causeway generate representations according to some other "standard", of which there are many:

* Mike Kelly's http://stateless.co/hal_specification.html[HAL] specification
* Mike Amundsen's http://amundsen.com/media-types/collection/[Collection+JSON] specification
* Kevin Swiber's https://github.com/kevinswiber/siren[Siren] specification
* Steve Klabnik's http://jsonapi.org/[JSON API] specification
* Gregg Cainus' https://github.com/cainus/hyper-json-spec[Hyper+JSON] specification
* the W3C's https://www.w3.org/TR/json-ld/[JSON-LD] specification
* Markus Lanthaler's http://www.markus-lanthaler.com/hydra/[Hydra] specification.

A good discussion about the relative merits of several of these different hypermedia formats can be found https://groups.google.com/forum/#!msg/api-craft/NgjzQYVOE4s/EAB2jxtU_TMJ[here].

Or, of course, you may have your own internal specification that you wish to use.

Supporting any of these alternative representations can be achieved by providing a suitable implementation of
`ContentNegotiationService`.
The existing implementations can be used as a starting point.

[CAUTION]
====
Any custom implementations will need to access the internal APIs for the Apache Causeway metamodel.
You should be aware that these are not formal API.
====

