001package org.gbif.api.documentation;
002
003import java.lang.annotation.Inherited;
004import java.lang.annotation.Retention;
005import java.lang.annotation.RetentionPolicy;
006import java.lang.annotation.Target;
007
008import io.swagger.v3.oas.annotations.Parameter;
009import io.swagger.v3.oas.annotations.enums.ParameterIn;
010import io.swagger.v3.oas.annotations.media.Schema;
011
012import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
013import static java.lang.annotation.ElementType.METHOD;
014
015public class CommonParameters {
016
017  /**
018   * The usual (search) limit and offset parameters
019   */
020  @Target({METHOD, ANNOTATION_TYPE})
021  @Retention(RetentionPolicy.RUNTIME)
022  @Inherited
023  @Parameter(
024    name = "hl",
025    description = "Set `hl=true` to highlight terms matching the query when in fulltext search fields. The highlight " +
026      "will be an emphasis tag of class `gbifHl`.",
027    schema = @Schema(implementation = Boolean.class),
028    in = ParameterIn.QUERY)
029  public @interface HighlightParameter {}
030
031  /**
032   * A normal full-text search parameter.
033   */
034  @Target({METHOD, ANNOTATION_TYPE})
035  @Retention(RetentionPolicy.RUNTIME)
036  @Inherited
037  @Parameter(
038    name = "q",
039    description = "Simple full text search parameter. The value for this parameter can be a simple word or a phrase. " +
040      "Wildcards are not supported",
041    schema = @Schema(implementation = String.class),
042    in = ParameterIn.QUERY)
043  public @interface QParameter {}
044}