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;
018
019/**
020 * Static constants shared across Juneau REST modules (for example {@code juneau-rest-server},
021 * {@code juneau-rest-client}, and {@code juneau-rest-mock}) so wire names and other cross-tier
022 * strings stay aligned.
023 *
024 * <p>
025 * Add more {@code public static final} fields here when server and client (or other REST modules)
026 * must agree on the same literal values.
027 */
028@SuppressWarnings({
029   "java:S115" // Names use HEADER_/QUERY_ + camelCase to mirror wire identifiers; not strict UPPER_SNAKE_CASE
030})
031public final class RestSharedConstants {
032
033   private RestSharedConstants() {}
034
035   /**
036    * Serializer session options request header (JSON5 object format).
037    *
038    * <p>
039    * HTTP header names are case-insensitive; use this spelling in OpenAPI and examples.
040    * Example value: <js>{escapeSolidus:true,maxIndent:4}</js>
041    */
042   public static final String HEADER_JuneauSerializerOptions = "X-Juneau-Serializer-Options";
043
044   /**
045    * Parser session options request header (JSON5 object format).
046    *
047    * <p>
048    * HTTP header names are case-insensitive; use this spelling in OpenAPI and examples.
049    * Example value: <js>{trimStrings:true}</js>
050    */
051   public static final String HEADER_JuneauParserOptions = "X-Juneau-Parser-Options";
052
053   /** Serializer session options query parameter (UON-encoded map format). Example: <js>(maxIndent=4,sortMaps=true)</js> */
054   public static final String QUERY_juneauSerializerOptions = "juneauSerializerOptions";
055
056   /** Parser session options query parameter (UON-encoded map format). Example: <js>(trimStrings=true)</js> */
057   public static final String QUERY_juneauParserOptions = "juneauParserOptions";
058}