Skip to content

Commit

Permalink
Add support for adding Markdown descriptions to models in OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Dec 13, 2022
1 parent 281c92c commit a982a01
Show file tree
Hide file tree
Showing 19 changed files with 227 additions and 197 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.Explode;
import io.swagger.v3.oas.annotations.extensions.Extension;
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.ExampleObject;
import io.swagger.v3.oas.annotations.media.Schema;
Expand Down Expand Up @@ -86,6 +88,7 @@ public class AnalysisResultSetsWebService {
public PaginatedResponseDataObject<DifferentialExpressionAnalysisResultSetValueObject> getResultSets(
@Parameter(schema = @Schema(implementation = DatasetArrayArg.class), explode = Explode.FALSE) @QueryParam("datasets") DatasetArrayArg datasets,
@Parameter(schema = @Schema(implementation = DatabaseEntryArrayArg.class), explode = Explode.FALSE) @QueryParam("databaseEntries") DatabaseEntryArrayArg databaseEntries,
@Schema(extensions = { @Extension(name = "gemma", properties = { @ExtensionProperty(name = "filteringService", value = "expressionAnalysisResultSetService") }) })
@QueryParam("filter") @DefaultValue("") FilterArg filters,
@QueryParam("offset") @DefaultValue("0") OffsetArg offset,
@QueryParam("limit") @DefaultValue("20") LimitArg limit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.Explode;
import io.swagger.v3.oas.annotations.extensions.Extension;
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
Expand Down Expand Up @@ -155,6 +157,7 @@ public ResponseDataObject<List<AnnotationSearchResultValueObject>> searchAnnotat
})
public PaginatedResponseDataObject<ExpressionExperimentValueObject> searchDatasets( // Params:
@Parameter(schema = @Schema(implementation = StringArrayArg.class), explode = Explode.FALSE) @QueryParam("query") @DefaultValue("") StringArrayArg query,
@Schema(extensions = { @Extension(name = "gemma", properties = { @ExtensionProperty(name = "filteringService", value = "expressionExperimentService") }) })
@QueryParam("filter") @DefaultValue("") FilterArg filterArg, // Optional, default null
@QueryParam("offset") @DefaultValue("0") OffsetArg offset, // Optional, default 0
@QueryParam("limit") @DefaultValue("20") LimitArg limit, // Optional, default 20
Expand Down Expand Up @@ -206,6 +209,7 @@ public PaginatedResponseDataObject<ExpressionExperimentValueObject> searchDatase
}, deprecated = true)
public PaginatedResponseDataObject<ExpressionExperimentValueObject> searchDatasetsByQueryInPath( // Params:
@PathParam("query") @DefaultValue("") StringArrayArg query, // Required
@Schema(extensions = { @Extension(name = "gemma", properties = { @ExtensionProperty(name = "filteringService", value = "expressionExperimentService") }) })
@QueryParam("filter") @DefaultValue("") FilterArg filterArg, // Optional, default null
@QueryParam("offset") @DefaultValue("0") OffsetArg offset, // Optional, default 0
@QueryParam("limit") @DefaultValue("20") LimitArg limit, // Optional, default 20
Expand All @@ -228,6 +232,7 @@ public PaginatedResponseDataObject<ExpressionExperimentValueObject> searchDatase
public PaginatedResponseDataObject<ExpressionExperimentValueObject> searchTaxonDatasets( // Params:
@PathParam("taxon") TaxonArg<?> taxonArg, // Required
@Parameter(schema = @Schema(implementation = StringArrayArg.class), explode = Explode.FALSE) @QueryParam("query") @DefaultValue("") StringArrayArg query,
@Schema(extensions = { @Extension(name = "gemma", properties = { @ExtensionProperty(name = "filteringService", value = "expressionExperimentService") }) })
@QueryParam("filter") @DefaultValue("") FilterArg filter, // Optional, default null
@QueryParam("offset") @DefaultValue("0") OffsetArg offset, // Optional, default 0
@QueryParam("limit") @DefaultValue("20") LimitArg limit, // Optional, default 20
Expand Down Expand Up @@ -273,6 +278,7 @@ public PaginatedResponseDataObject<ExpressionExperimentValueObject> searchTaxonD
public PaginatedResponseDataObject<ExpressionExperimentValueObject> searchTaxonDatasetsByQueryInPath( // Params:
@PathParam("taxon") TaxonArg<?> taxonArg, // Required
@PathParam("query") @DefaultValue("") StringArrayArg query, // Required
@Schema(extensions = { @Extension(name = "gemma", properties = { @ExtensionProperty(name = "filteringService", value = "expressionExperimentService") }) })
@QueryParam("filter") @DefaultValue("") FilterArg filter, // Optional, default null
@QueryParam("offset") @DefaultValue("0") OffsetArg offset, // Optional, default 0
@QueryParam("limit") @DefaultValue("20") LimitArg limit, // Optional, default 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
package ubic.gemma.web.services.rest;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.extensions.Extension;
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
Expand Down Expand Up @@ -128,6 +130,7 @@ public DatasetsWebService( ExpressionExperimentService expressionExperimentServi
@Produces(MediaType.APPLICATION_JSON)
@Operation(summary = "Retrieve all datasets")
public PaginatedResponseDataObject<ExpressionExperimentValueObject> getDatasets( // Params:
@Schema(extensions = { @Extension(name = "gemma", properties = { @ExtensionProperty(name = "filteringService", value = "expressionExperimentService") }) })
@QueryParam("filter") @DefaultValue("") FilterArg filter, // Optional, default null
@QueryParam("offset") @DefaultValue("0") OffsetArg offset, // Optional, default 0
@QueryParam("limit") @DefaultValue("20") LimitArg limit, // Optional, default 20
Expand Down Expand Up @@ -159,6 +162,7 @@ public PaginatedResponseDataObject<ExpressionExperimentValueObject> getDatasets(
@Operation(summary = "Retrieve datasets by their identifiers")
public PaginatedResponseDataObject<ExpressionExperimentValueObject> getDatasetsByIds( // Params:
@PathParam("dataset") DatasetArrayArg datasetsArg, // Optional
@Schema(extensions = { @Extension(name = "gemma", properties = { @ExtensionProperty(name = "filteringService", value = "expressionExperimentService") }) })
@QueryParam("filter") @DefaultValue("") FilterArg filter, // Optional, default null
@QueryParam("offset") @DefaultValue("0") OffsetArg offset, // Optional, default 0
@QueryParam("limit") @DefaultValue("20") LimitArg limit, // Optional, default 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
package ubic.gemma.web.services.rest;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.extensions.Extension;
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
Expand Down Expand Up @@ -88,6 +90,7 @@ public PlatformsWebService( GeneService geneService, ArrayDesignService arrayDes
@Produces(MediaType.APPLICATION_JSON)
@Operation(summary = "Retrieve all platforms")
public PaginatedResponseDataObject<ArrayDesignValueObject> getPlatforms( // Params:
@Schema(extensions = { @Extension(name = "gemma", properties = { @ExtensionProperty(name = "filteringService", value = "arrayDesignService") }) })
@QueryParam("filter") @DefaultValue("") FilterArg filter, // Optional, default null
@QueryParam("offset") @DefaultValue("0") OffsetArg offset, // Optional, default 0
@QueryParam("limit") @DefaultValue("20") LimitArg limit, // Optional, default 20
Expand Down Expand Up @@ -115,6 +118,7 @@ public PaginatedResponseDataObject<ArrayDesignValueObject> getPlatforms( // Para
@Operation(summary = "Retrieve all platforms matching a set of platform identifiers")
public PaginatedResponseDataObject<ArrayDesignValueObject> getPlatformsByIds( // Params:
@PathParam("platform") PlatformArrayArg datasetsArg, // Optional
@Schema(extensions = { @Extension(name = "gemma", properties = { @ExtensionProperty(name = "filteringService", value = "arrayDesignService") }) })
@QueryParam("filter") @DefaultValue("") FilterArg filter, // Optional, default null
@QueryParam("offset") @DefaultValue("0") OffsetArg offset, // Optional, default 0
@QueryParam("limit") @DefaultValue("20") LimitArg limit, // Optional, default 20
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import ubic.gemma.model.genome.sequenceAnalysis.BioSequenceValueObject;
import ubic.gemma.persistence.service.expression.arrayDesign.ArrayDesignService;
import ubic.gemma.persistence.service.genome.taxon.TaxonService;
import ubic.gemma.web.services.rest.swagger.resolvers.SearchResultTypeAllowableValuesModelResolver;
import ubic.gemma.web.services.rest.util.ResponseDataObject;
import ubic.gemma.web.services.rest.util.args.LimitArg;
import ubic.gemma.web.services.rest.util.args.PlatformArg;
Expand Down Expand Up @@ -75,7 +74,7 @@ public class SearchWebService {
/**
* Search everything subject to taxon and platform constraints.
* <p>
* Naming the schema in for the result types is necessary so that it can be resolved in {@link SearchResultTypeAllowableValuesModelResolver}.
* Naming the schema in for the result types is necessary so that it can be resolved in {@link ubic.gemma.web.services.rest.swagger.resolver.CustomModelResolver}.
*/
@GET
@Produces(MediaType.APPLICATION_JSON_VALUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.Explode;
import io.swagger.v3.oas.annotations.extensions.Extension;
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down Expand Up @@ -225,6 +227,7 @@ public ResponseDataObject<List<PhysicalLocationValueObject>> getGeneLocationsInT
@Operation(summary = "Retrieve the datasets for a given taxon")
public PaginatedResponseDataObject<ExpressionExperimentValueObject> getTaxonDatasets( // Params:
@PathParam("taxon") TaxonArg<?> taxonArg, // Required
@Schema(extensions = { @Extension(name = "gemma", properties = { @ExtensionProperty(name = "filteringService", value = "expressionExperimentService") }) })
@QueryParam("filter") @DefaultValue("") FilterArg filter, // Optional, default null
@QueryParam("offset") @DefaultValue("0") OffsetArg offset, // Optional, default 0
@QueryParam("limit") @DefaultValue("20") LimitArg limit, // Optional, default 20
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit a982a01

Please sign in to comment.