@@ -72,37 +72,34 @@ QuerydslPredicateOperationCustomizer queryDslQuerydslPredicateOperationCustomize
72
72
}
73
73
}
74
74
75
- @ ConditionalOnClass (RepositoryRestConfiguration .class )
76
- class HalProviderConfiguration {
77
75
78
- @ Bean
79
- @ ConditionalOnMissingBean
80
- HalProvider halProvider (Optional <RepositoryRestConfiguration > repositoryRestConfiguration ) {
81
- return repositoryRestConfiguration . isPresent () ? new HalProvider (repositoryRestConfiguration . get ()) : null ;
82
- }
76
+ @ Bean
77
+ @ ConditionalOnMissingBean
78
+ HalProvider halProvider (Optional <RepositoryRestConfiguration > repositoryRestConfiguration ) {
79
+ return new HalProvider (repositoryRestConfiguration ) ;
80
+ }
83
81
84
- /**
85
- * Registers an OpenApiCustomiser and a jackson mixin to ensure the definition of `Links` matches the serialized
86
- * output. This is done because the customer serializer converts the data to a map before serializing it.
87
- *
88
- * @see org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)
89
- */
90
- @ Bean
91
- OpenApiCustomiser linksSchemaCustomiser (Optional <RepositoryRestConfiguration > repositoryRestConfiguration ) {
92
- if (!repositoryRestConfiguration .isPresent () || !repositoryRestConfiguration .get ().useHalAsDefaultJsonMediaType ()) {
93
- return openApi -> {
94
- };
95
- }
96
- Json .mapper ().addMixIn (RepresentationModel .class , RepresentationModelLinksOASMixin .class );
82
+ /**
83
+ * Registers an OpenApiCustomiser and a jackson mixin to ensure the definition of `Links` matches the serialized
84
+ * output. This is done because the customer serializer converts the data to a map before serializing it.
85
+ *
86
+ * @see org.springframework.hateoas.mediatype.hal.Jackson2HalModule.HalLinkListSerializer#serialize(Links, JsonGenerator, SerializerProvider)
87
+ */
88
+ @ Bean
89
+ OpenApiCustomiser linksSchemaCustomiser (Optional <RepositoryRestConfiguration > repositoryRestConfiguration ) {
90
+ if (!repositoryRestConfiguration .isPresent () || !repositoryRestConfiguration .get ().useHalAsDefaultJsonMediaType ()) {
91
+ return openApi -> {
92
+ };
93
+ }
94
+ Json .mapper ().addMixIn (RepresentationModel .class , RepresentationModelLinksOASMixin .class );
97
95
98
- ResolvedSchema resolvedLinkSchema = ModelConverters .getInstance ()
99
- .resolveAsResolvedSchema (new AnnotatedType (Link .class ).resolveAsRef (true ));
96
+ ResolvedSchema resolvedLinkSchema = ModelConverters .getInstance ()
97
+ .resolveAsResolvedSchema (new AnnotatedType (Link .class ).resolveAsRef (true ));
100
98
101
- return openApi -> openApi
102
- .schema ("Link" , resolvedLinkSchema .schema )
103
- .schema ("Links" , new MapSchema ()
104
- .additionalProperties (new StringSchema ())
105
- .additionalProperties (new ObjectSchema ().$ref ("#/components/schemas/Link" )));
106
- }
99
+ return openApi -> openApi
100
+ .schema ("Link" , resolvedLinkSchema .schema )
101
+ .schema ("Links" , new MapSchema ()
102
+ .additionalProperties (new StringSchema ())
103
+ .additionalProperties (new ObjectSchema ().$ref ("#/components/schemas/Link" )));
107
104
}
108
105
}
0 commit comments