001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.rest.server.config; 018 019import org.apache.juneau.commons.bean.*; 020import org.apache.juneau.marshall.encoders.*; 021import org.apache.juneau.marshall.oapi.*; 022import org.apache.juneau.marshall.serializer.*; 023import org.apache.juneau.rest.server.*; 024import org.apache.juneau.rest.server.arg.*; 025import org.apache.juneau.rest.server.auth.*; 026import org.apache.juneau.rest.server.openapi.*; 027import org.apache.juneau.rest.server.processor.*; 028import org.apache.juneau.rest.server.staticfile.*; 029import org.apache.juneau.rest.server.swagger.*; 030 031/** 032 * Predefined REST configuration that defines common default values for all configurations. 033 */ 034// @formatter:off 035@Rest( 036 // Configuration file. 037 config="$S{j.configFile,$E{J_CONFIG_FILE,SYSTEM_DEFAULT}}", 038 039 // Standard fields. 040 path="", 041 roleGuard="", 042 rolesDeclared="", 043 044 // Configuration beans. 045 converters={}, 046 encoders={IdentityEncoder.class}, 047 guards={}, 048 parsers={}, 049 partParser=OpenApiParser.class, 050 partSerializer=OpenApiSerializer.class, 051 responseProcessors={ 052 AsyncResponseProcessor.class, 053 ReaderProcessor.class, 054 InputStreamProcessor.class, 055 ThrowableProcessor.class, 056 ProblemDetailsProcessor.class, 057 HttpResponseProcessor.class, 058 HttpResourceProcessor.class, 059 HttpBodyProcessor.class, 060 ResponseBeanProcessor.class, 061 PlainTextPojoProcessor.class, 062 SerializedPojoProcessor.class 063 }, 064 restOpArgs={ 065 AttributeArg.class, 066 AuthArg.class, 067 ContentArg.class, 068 FormDataArg.class, 069 HasFormDataArg.class, 070 HasQueryArg.class, 071 HeaderArg.class, 072 HttpServletRequestArgs.class, 073 HttpServletResponseArgs.class, 074 HttpSessionArgs.class, 075 InputStreamParserArg.class, 076 MethodArg.class, 077 ParserArg.class, 078 PathArg.class, 079 PathRemainderArg.class, 080 QueryArg.class, 081 ReaderParserArg.class, 082 RecordReaderArg.class, 083 RecordWriterArg.class, 084 RequestBeanArg.class, 085 ResponseBeanArg.class, 086 ResponseHeaderArg.class, 087 ResponseCodeArg.class, 088 RestContextArgs.class, 089 RestSessionArgs.class, 090 RestOpContextArgs.class, 091 RestOpSessionArgs.class, 092 RestRequestArgs.class, 093 RestResponseArgs.class, 094 SseBroadcasterArg.class, 095 SseSubscriptionArg.class, 096 TokenReaderArg.class, 097 TokenWriterArg.class, 098 DefaultArg.class 099 }, 100 serializers={}, 101 102 // Configurable settings. 103 allowedHeaderParams="$S{j.allowedHeaderParams,$E{J_ALLOWED_HEADER_PARAMS,Accept,Content-Type}}", 104 allowedMethodHeaders="$S{j.allowedMethodHeaders,$E{J_ALLOWED_METHOD_HEADERS,}}", 105 allowedMethodParams="$S{j.allowedMethodParams,$E{J_ALLOWED_METHOD_PARAMS,HEAD,OPTIONS}}", 106 clientVersionHeader="$S{j.clientVersionHeader,$E{J_CLIENT_VERSION_HEADER,Client-Version}}", 107 defaultAccept="$S{j.defaultAccept,$E{J_DEFAULT_ACCEPT,}}", 108 defaultCharset="$S{j.defaultCharset,$E{J_DEFAULT_CHARSET,UTF-8}}", 109 defaultContentType="$S{j.defaultContentType,$E{J_DEFAULT_CONTENT_TYPE,}}", 110 defaultRequestAttributes="$S{j.defaultRequestAttributes,$E{J_DEFAULT_REQUEST_ATTRIBUTES,}}", 111 defaultRequestHeaders="$S{j.defaultRequestHeaders,$E{J_DEFAULT_REQUEST_HEADERS,}}", 112 defaultResponseHeaders="$S{j.defaultResponseHeaders,$E{J_DEFAULT_RESPONSE_HEADERS,}}", 113 disableContentParam="$S{j.disableContentParam,$E{J_DISABLE_CONTENT_PARAM,false}}", 114 maxInput="$S{j.maxInput,$E{J_MAX_INPUT,1000000}}", 115 messages="$S{j.messages,$E{J_MESSAGES,}}", 116 renderResponseStackTraces="$S{j.renderResponseStackTraces,$E{J_RENDER_RESPONSE_STACK_TRACES,false}}", 117 uriAuthority="$S{j.uriAuthority,$E{J_URI_AUTHORITY,}}", 118 uriContext="$S{j.uriContext,$E{J_URI_CONTEXT,}}", 119 uriRelativity="$S{j.uriRelativity,$E{J_URI_RELATIVITY,}}", 120 uriResolution="$S{j.uriResolution,$E{J_URI_RESOLUTION,}}", 121 122 // Metadata settings. 123 consumes={}, 124 description="", 125 produces={}, 126 siteName="$S{j.siteName,$E{J_SITE_NAME,}}", 127 swagger=@Swagger, 128 title="$S{j.title,$E{J_TITLE,}}", 129 130 // Injectable/overridable beans. 131 staticFiles=StaticFiles.Void.class, // Defaults to BasicStaticFiles. 132 swaggerProvider=SwaggerProvider.Void.class, // Defaults to BasicSwaggerProvider. 133 openApiProvider=OpenApiProvider.Void.class // Defaults to BasicOpenApiProvider. 134) 135@BeanConfig( 136 // When parsing generated beans, ignore unknown properties that may only exist as getters and not setters. 137 ignoreUnknownBeanProperties="true", 138 ignoreUnknownEnumValues="true" 139) 140@SerializerConfig( 141 // Enable automatic resolution of URI objects to root-relative values. 142 uriResolution="ROOT_RELATIVE" 143) 144public interface DefaultConfig {}