Pro Jakarta EE 10 by Peter Späth

Pro Jakarta EE 10 by Peter Späth

Author:Peter Späth
Language: eng
Format: epub
ISBN: 9781484282144
Publisher: Apress


Adapt the contents according to your needs. In addition, you can add an OpenAPI annotation to the REST class RestDate.java:@Path("/d")

public class RestDate {

...

@GET

@Produces("application/json")

// OpenAPI

@Operation(summary = "Outputs the date",

description = "This method outputs the date")

public String stdDate() {

return "{"date":"" +

ZonedDateTime.now().toString() + ""}";

}

...

}

OpenAPI can do a lot more. For details, see the OpenAPI specification.

Next, let the application report some performance figures. This is what the Metrics 4.0 specification is about. To use it, add a couple of annotations to the REST method as follows: ...

@GET

@Produces("application/json")



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.