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.springboot;
018
019import org.apache.juneau.marshall.html.*;
020import org.apache.juneau.marshall.jsonschema.*;
021import org.apache.juneau.rest.server.*;
022import org.apache.juneau.rest.server.config.*;
023import org.apache.juneau.rest.server.convention.*;
024import org.apache.juneau.rest.server.ops.*;
025
026/**
027 * Subclass of {@link SpringRestServlet} with default settings and standard endpoints defined.
028 *
029 * <p>
030 * Meant as base class for top-level REST resources in Spring Boot environments.
031 *
032 * <p>
033 * Provides support for JSON, XML, HTML, URL-Encoding, UON, XML, OpenAPI, and MessagePack.  See {@link BasicUniversalConfig}
034 * for details.
035 *
036 * <p>
037 * The residual cross-cutting endpoints are supplied by single-responsibility op-mixins ({@link ErrorMixin},
038 * {@link HtdocMixin}, and {@link FaviconMixin}).
039 *
040 * <h2 class='section'>See Also:</h2><ul>
041 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauRestServerSpringboot">juneau-rest-server-springboot</a>
042 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/RestAnnotatedClasses">@Rest-Annotated Class</a>
043 * </ul>
044 *
045 * @serial exclude
046 */
047// @formatter:off
048@Rest(mixins={ErrorMixin.class, HtdocMixin.class, FaviconMixin.class})
049@HtmlDocConfig(
050   // Basic page navigation links.
051   navlinks={
052      "up: request:/..",
053      "api: servlet:/api"
054   }
055)
056@JsonSchemaConfig(
057   // Add descriptions to the following types when not specified:
058   addDescriptionsTo="bean,collection,array,map,enum",
059   // Add example to the following types:
060   addExamplesTo="bean,collection,array,map",
061   // Don't generate schema information on the Swagger / OpenApi beans themselves or HTML beans.
062   ignoreTypes="Swagger,OpenApi,org.apache.juneau.bean.html5.*",
063   // Use $ref references for bean definitions to reduce duplication in generated specs.
064   useBeanDefs="true"
065)
066// @formatter:on
067public abstract class BasicSpringRestServlet extends SpringRestServlet implements BasicUniversalConfig {
068   private static final long serialVersionUID = 1L;
069}