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}, {@link StatsMixin}, and {@link FaviconMixin}).
039 *
040 * <h5 class='section'>See Also:</h5><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, StatsMixin.class, FaviconMixin.class})
049@HtmlDocConfig(
050   // Basic page navigation links.
051   navlinks={
052      "up: request:/..",
053      "api: servlet:/api",
054      "stats: servlet:/stats"
055   }
056)
057@JsonSchemaConfig(
058   // Add descriptions to the following types when not specified:
059   addDescriptionsTo="bean,collection,array,map,enum",
060   // Add example to the following types:
061   addExamplesTo="bean,collection,array,map",
062   // Don't generate schema information on the Swagger / OpenApi beans themselves or HTML beans.
063   ignoreTypes="Swagger,OpenApi,org.apache.juneau.bean.html5.*",
064   // Use $ref references for bean definitions to reduce duplication in generated specs.
065   useBeanDefs="true"
066)
067// @formatter:on
068public abstract class BasicSpringRestServlet extends SpringRestServlet implements BasicUniversalConfig {
069   private static final long serialVersionUID = 1L;
070}