Class ProjectMetadataController

java.lang.Object
io.spring.initializr.web.controller.AbstractMetadataController
io.spring.initializr.web.controller.ProjectMetadataController

@RestController public class ProjectMetadataController extends AbstractMetadataController
RestController that exposes metadata and service configuration.
Author:
Stephane Nicoll
  • Field Details

    • HAL_JSON_CONTENT_TYPE

      public static final org.springframework.http.MediaType HAL_JSON_CONTENT_TYPE
      HAL JSON content type.
  • Constructor Details

  • Method Details

    • config

      @GetMapping(path="/metadata/config", produces="application/json") public InitializrMetadata config()
    • serviceCapabilitiesHal

      @GetMapping(path={"/","/metadata/client"}, produces="application/hal+json") public org.springframework.http.ResponseEntity<String> serviceCapabilitiesHal()
    • serviceCapabilitiesV22

      @GetMapping(path={"/","/metadata/client"}, produces="application/vnd.initializr.v2.2+json") public org.springframework.http.ResponseEntity<String> serviceCapabilitiesV22()
    • serviceCapabilitiesV21

      @GetMapping(path={"/","/metadata/client"}, produces={"application/vnd.initializr.v2.1+json","application/json"}) public org.springframework.http.ResponseEntity<String> serviceCapabilitiesV21()
    • serviceCapabilitiesV2

      @GetMapping(path={"/","/metadata/client"}, produces="application/vnd.initializr.v2+json") public org.springframework.http.ResponseEntity<String> serviceCapabilitiesV2()
    • dependenciesV22

      @GetMapping(path="/dependencies", produces="application/vnd.initializr.v2.2+json") public org.springframework.http.ResponseEntity<String> dependenciesV22(@RequestParam(required=false) String bootVersion)
    • dependenciesV21

      @GetMapping(path="/dependencies", produces={"application/vnd.initializr.v2.1+json","application/json"}) public org.springframework.http.ResponseEntity<String> dependenciesV21(@RequestParam(required=false) String bootVersion)
    • invalidMetadataRequest

      @ExceptionHandler public void invalidMetadataRequest(jakarta.servlet.http.HttpServletResponse response, InvalidInitializrMetadataException ex) throws IOException
      Throws:
      IOException
    • invalidProjectRequest

      @ExceptionHandler public void invalidProjectRequest(jakarta.servlet.http.HttpServletResponse response, InvalidProjectRequestException ex) throws IOException
      Throws:
      IOException
    • determineCacheControlFor

      protected org.springframework.http.CacheControl determineCacheControlFor(InitializrMetadata metadata)
      Return the CacheControl response headers to use for the specified metadata. If no cache should be applied CacheControl.empty() can be used.
      Parameters:
      metadata - the metadata about to be exposed
      Returns:
      the Cache-Control headers to use