Skip to content

Commit

Permalink
java-jaxrs-server: replace CacheControl.valueOf as it is now deprecated
Browse files Browse the repository at this point in the history
CacheControl.valueOf is now deprecated. Instead they suggest using RuntimeDelegate.getInstance().createHeaderDelegate(CacheControl.class).fromString
  • Loading branch information
Sholto authored and Sholto committed Sep 20, 2023
1 parent 02d574d commit eac81b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/java-jaxrs-server/templates/apiImpl.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class {{className name}}ApiImpl implements {{apiPackage}}.{{className nam
{{#each operations}}
public {{javax}}.ws.rs.core.Response {{name}}({{#each parameters}}{{{nativeType}}} {{identifier name}}{{#hasMore}}, {{/hasMore}}{{/each}}{{#if requestBody.nativeType}}{{#if parameters}}, {{/if}}{{{requestBody.nativeType}}} {{identifier requestBody.name}}{{/if}}) {
{{#with defaultResponse}}
final {{javax}}.ws.rs.core.Response.ResponseBuilder __response = {{javax}}.ws.rs.core.Response.status({{code}}).cacheControl({{javax}}.ws.rs.core.CacheControl.valueOf("{{#ifvex 'x-cache-control'}}{{{vendorExtensions.x-cache-control}}}{{else}}no-cache, no-store, must-revalidate, private{{/ifvex}}"));
final {{javax}}.ws.rs.core.Response.ResponseBuilder __response = {{javax}}.ws.rs.core.Response.status({{code}}).cacheControl({{javax}}.ws.rs.ext.RuntimeDelegate.getInstance().createHeaderDelegate({{javax}}.ws.rs.core.CacheControl.class).fromString("{{#ifvex 'x-cache-control'}}{{{vendorExtensions.x-cache-control}}}{{else}}no-cache, no-store, must-revalidate, private{{/ifvex}}"));
{{/with}}
try {
{{#if @root.useBeanValidation}}
Expand Down

0 comments on commit eac81b7

Please sign in to comment.