001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.rest.config;
014
015import org.apache.juneau.annotation.*;
016import org.apache.juneau.json.*;
017import org.apache.juneau.rest.annotation.*;
018import org.apache.juneau.serializer.annotation.*;
019
020/**
021 * Basic configuration for a REST resource that supports JSON transport.
022 */
023@Rest(
024
025   // Default serializers for all Java methods in the class.
026   serializers={
027      JsonSerializer.class,
028   },
029
030   // Default parsers for all Java methods in the class.
031   parsers={
032      JsonParser.class,
033   },
034
035   defaultAccept="text/json",
036
037   // Optional external configuration file.
038   config="$S{juneau.configFile,SYSTEM_DEFAULT}",
039
040   logging=@Logging(
041      level="INFO",
042      useStackTraceHashing="true",
043      rules={
044         @LoggingRule(codes="500-", level="WARNING")
045      }
046   )
047)
048@SerializerConfig(
049   // Enable automatic resolution of URI objects to root-relative values.
050   uriResolution="ROOT_RELATIVE"
051)
052@BeanConfig(
053   // When parsing generated beans, ignore unknown properties that may only exist as getters and not setters.
054   ignoreUnknownBeanProperties="true"
055)
056public interface BasicJsonRest {}