@@ -175,7 +175,7 @@ class BackendSpringConfig {
175175 return @OperationCustomizer operation
176176 }
177177
178- val endpointDocs = QUERY_ENDPOINT_DOCS [ handlerMethod.method.name]
178+ val endpointDocs = queryEndpointDocs( handlerMethod.method.name)
179179 operation.tags = listOf (" Query" )
180180 operation.summary = endpointDocs?.summary ? : operation.summary
181181 operation.description = endpointDocs?.description ? : operation.description
@@ -206,6 +206,9 @@ class BackendSpringConfig {
206206 private companion object {
207207 data class QueryEndpointDocs (val summary : String , val description : String )
208208
209+ fun queryEndpointDocs (methodName : String ) =
210+ QUERY_ENDPOINT_DOCS [methodName] ? : methodName.removeSuffix(" Get" ).let { QUERY_ENDPOINT_DOCS [it] }
211+
209212 val QUERY_ENDPOINT_DOCS = mapOf (
210213 " metadata" to QueryEndpointDocs (
211214 " Query metadata" ,
@@ -267,66 +270,6 @@ class BackendSpringConfig {
267270 " Aggregate amino acid mutations" ,
268271 " Return aggregated amino acid mutations for one gene." ,
269272 ),
270- " metadataGet" to QueryEndpointDocs (
271- " Download metadata" ,
272- " Download metadata rows for sequence entries visible to the authenticated user." ,
273- ),
274- " aggregatedGet" to QueryEndpointDocs (
275- " Download aggregated metadata" ,
276- " Download aggregated metadata counts for visible sequence entries." ,
277- ),
278- " sequencesGet" to QueryEndpointDocs (
279- " Download unaligned nucleotide sequences" ,
280- " Download unaligned nucleotide sequences for visible sequence entries." ,
281- ),
282- " sequencesForSegmentGet" to QueryEndpointDocs (
283- " Download unaligned nucleotide sequences by segment" ,
284- " Download unaligned nucleotide sequences for one segment." ,
285- ),
286- " sequencesAlignedGet" to QueryEndpointDocs (
287- " Download aligned nucleotide sequences" ,
288- " Download aligned nucleotide sequences for visible sequence entries." ,
289- ),
290- " sequencesAlignedForSegmentGet" to QueryEndpointDocs (
291- " Download aligned nucleotide sequences by reference" ,
292- " Download aligned nucleotide sequences for one reference." ,
293- ),
294- " sequencesAlignedMutationsGet" to QueryEndpointDocs (
295- " Download nucleotide mutations" ,
296- " Download nucleotide mutation records for visible sequence entries." ,
297- ),
298- " sequencesAlignedInsertionsGet" to QueryEndpointDocs (
299- " Download nucleotide insertions" ,
300- " Download nucleotide insertion records for visible sequence entries." ,
301- ),
302- " sequencesAlignedAggregatedMutationsGet" to QueryEndpointDocs (
303- " Download aggregated nucleotide mutations" ,
304- " Download aggregated nucleotide mutations for visible sequence entries." ,
305- ),
306- " sequencesAlignedForSegmentMutationsGet" to QueryEndpointDocs (
307- " Download nucleotide mutations by reference" ,
308- " Download nucleotide mutation records for one reference." ,
309- ),
310- " sequencesAlignedForSegmentAggregatedMutationsGet" to QueryEndpointDocs (
311- " Download aggregated nucleotide mutations by reference" ,
312- " Download aggregated nucleotide mutations for one reference." ,
313- ),
314- " translationsGet" to QueryEndpointDocs (
315- " Download aligned amino acid sequences" ,
316- " Download aligned amino acid sequences for one gene." ,
317- ),
318- " translationsMutationsGet" to QueryEndpointDocs (
319- " Download amino acid mutations" ,
320- " Download amino acid mutation records for visible sequence entries." ,
321- ),
322- " translationsInsertionsGet" to QueryEndpointDocs (
323- " Download amino acid insertions" ,
324- " Download amino acid insertion records for visible sequence entries." ,
325- ),
326- " translationsAggregatedMutationsGet" to QueryEndpointDocs (
327- " Download aggregated amino acid mutations" ,
328- " Download aggregated amino acid mutations for one gene." ,
329- ),
330273 )
331274 }
332275}
0 commit comments