Package org.zalando.twintip.spring
Class SchemaResource
- java.lang.Object
-
- org.zalando.twintip.spring.SchemaResource
-
@RestController public class SchemaResource extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringSCHEMA_DISCOVERY_MAPPING
-
Constructor Summary
Constructors Constructor Description SchemaResource(org.springframework.core.io.Resource yamlResource, boolean enableCors, String baseUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchemaDiscoverydiscover(String mapping, String type, String uiPath)org.springframework.http.ResponseEntity<String>jsonSchema()org.springframework.http.ResponseEntity<String>yamlSchema()
-
-
-
Field Detail
-
SCHEMA_DISCOVERY_MAPPING
public static final String SCHEMA_DISCOVERY_MAPPING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SchemaResource
@Autowired public SchemaResource(@Value("${twintip.yaml}") org.springframework.core.io.Resource yamlResource, @Value("${twintip.cors:true}") boolean enableCors, @Value("${twintip.baseUrl:}") String baseUrl) throws IOException- Throws:
IOException
-
-
Method Detail
-
discover
@RequestMapping(method=GET, value="/.well-known/schema-discovery", produces="application/json") @ResponseStatus(OK) public SchemaDiscovery discover(@Value("${twintip.mapping}") String mapping, @Value("${twintip.type:swagger-2.0}") String type, @Value("${twintip.ui:}") String uiPath)
-
jsonSchema
@RequestMapping(method=GET, value="${twintip.mapping}", produces={"application/json","*/*"}) @ResponseStatus(OK) public org.springframework.http.ResponseEntity<String> jsonSchema() throws com.fasterxml.jackson.core.JsonProcessingException- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
yamlSchema
@RequestMapping(method=GET, value="${twintip.mapping}", produces={"application/yaml","application/x-yaml","text/yaml"}) @ResponseStatus(OK) @ResponseBody public org.springframework.http.ResponseEntity<String> yamlSchema() throws com.fasterxml.jackson.core.JsonProcessingException- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-