server-templates/apiService.mustache (55 lines of code) (raw):

/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package {{package}}; {{#operations}}{{#operation}}{{#isMultipart}}import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput; {{/isMultipart}}{{/operation}}{{/operations}} {{#imports}}import {{import}}; {{/imports}} import java.util.List; import java.io.InputStream; {{#useBeanValidation}} import {{javaxPackage}}.validation.constraints.*; import {{javaxPackage}}.validation.Valid; {{/useBeanValidation}} import {{javaxPackage}}.ws.rs.core.Response; import {{javaxPackage}}.ws.rs.core.SecurityContext; import org.apache.polaris.core.context.RealmContext; {{! Note that this template is copied from https://github.com/OpenAPITools/openapi-generator/blob/783e68c7acbbdcbb2282d167d1644b069f12d486/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/apiService.mustache It is here to remove some unsupported imports and to update the default implementation to return a 501 response code }} /** * Service interface for implementations of the {{classname}}Service. Provides default * implemntations for all service methods that return 501 error codes (not implemented). * * This file is automatically generated by the OpenAPI Code Generator based on configuration in the * pom.xml file in the module. * */ {{>generatedAnnotation}} {{#operations}} public interface {{classname}}Service { {{#operation}} default Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{^isMultipart}}{{>serviceFormParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}RealmContext realmContext,SecurityContext securityContext) { return Response.status(501).build(); // not implemented } {{/operation}} } {{/operations}}