Skip to content

Package refactorings to add SPI to create custom media type implementations #833

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

Closed
gregturn opened this issue Feb 26, 2019 · 1 comment
Closed
Assignees
Milestone

Comments

@gregturn
Copy link
Contributor

  • Create an SPI for registering 3rd party media type providers.
  • Define an API for what these media type suppliers must implement to define the actual MediaType and either ObjectMapper or Jackson Module used to serialize/deserialize.

By implementing these interfaces, new media types can be picked up dynamically and registered with Spring MVC, Spring WebFlux, RestTemplate beans, and WebClient beans.

@gregturn gregturn added this to the 1.0 M1 milestone Feb 26, 2019
@odrotbohm odrotbohm self-assigned this Feb 27, 2019
@odrotbohm odrotbohm changed the title Create custom media types Package refactorings to add SPI to create custom media type implementations Feb 27, 2019
odrotbohm added a commit that referenced this issue Feb 28, 2019
We now expose a MediaTypeConfigurationProvider SPI interface that media type implementations can register an implementation class for in META-INF/spring.factories. The implementation class then has to provide a root Spring configuration class to be included into the bootstrap and expose whether it's supposed to be included for a given set of media types.

Configuration classes are supposed to implement HypermediaMappingInformation to expose either a Jackson module or code to configure the Jackson ObjectMapper to be used in the mapping infrastructure of the supported web stacks (WebMVC and WebFlux).
odrotbohm added a commit that referenced this issue Feb 28, 2019
Changed the package structure to better reflect the different modules of the library. All client related code now lives in the client package, server related APIs in server with their respective WebMVC and WebFlux implementations in sub-packages.

Added migration script to allow users to easily migrate to the new structure and added reference documentation section on the migration.

Traversons built in defaulting to HAL HttpMessageConverters and LinkDiscoverer implementation now caused a cyclic relationship between the client and mediatype.hal packages. This has be fixed by looking up the defaults via a SpringFactories interface.
@gregturn
Copy link
Contributor Author

Resolved.

odrotbohm pushed a commit that referenced this issue Mar 18, 2019
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://maven.apache.org/xsd/maven-4.0.0.xsd with 1 occurrences migrated to:
  https://maven.apache.org/xsd/maven-4.0.0.xsd ([https](https://maven.apache.org/xsd/maven-4.0.0.xsd) result 200).
* http://www.apache.org/licenses/LICENSE-2.0 with 4 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
* http://static.springframework.org/spring/docs/4.1.x/javadoc-api (301) with 1 occurrences migrated to:
  https://docs.spring.io/spring/docs/4.1.x/javadoc-api ([https](https://static.springframework.org/spring/docs/4.1.x/javadoc-api) result 301).
* http://github.com/SpringSource/spring-hateoas with 1 occurrences migrated to:
  https://github.com/SpringSource/spring-hateoas ([https](https://github.com/SpringSource/spring-hateoas) result 301).
* http://www.spring.io with 1 occurrences migrated to:
  https://www.spring.io ([https](https://www.spring.io) result 301).
* http://docs.oracle.com/javase/6/docs/api with 1 occurrences migrated to:
  https://docs.oracle.com/javase/6/docs/api ([https](https://docs.oracle.com/javase/6/docs/api) result 302).
* http://repo.spring.io/libs-snapshot with 2 occurrences migrated to:
  https://repo.spring.io/libs-snapshot ([https](https://repo.spring.io/libs-snapshot) result 302).

# Ignored
These URLs were intentionally ignored.

* http://maven.apache.org/POM/4.0.0 with 2 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 1 occurrences
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants