Skip to content

Commit

Permalink
docs(lapis): fix LapisInfo schema in OpenAPI specs
Browse files Browse the repository at this point in the history
  • Loading branch information
fengelniederhammer committed Oct 15, 2024
1 parent a485b74 commit c89ef6c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,11 @@ private fun infoResponseSchema() =
.description(LAPIS_DATA_VERSION_RESPONSE_DESCRIPTION)
.example(LAPIS_DATA_VERSION_EXAMPLE),
"requestId" to Schema<String>().type("string").description(REQUEST_ID_HEADER_DESCRIPTION),
"requestInfo" to Schema<String>().type("string").description(REQUEST_INFO_STRING_DESCRIPTION),
"reportTo" to Schema<String>().type("string"),
),
)
.required(listOf("dataVersion"))
.required(listOf("reportTo"))

private fun aggregatedMetadataFieldSchemas(databaseConfig: DatabaseConfig) =
databaseConfig.schema.metadata.associate { it.name to Schema<String>().type(mapToOpenApiType(it.type)) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ A UUID that uniquely identifies the request for tracing purposes.
If none if provided in the request, LAPIS will generate one.
"""

const val REQUEST_INFO_STRING_DESCRIPTION =
"Some information about the request in human readable form. Intended for debugging."

const val DOWNLOAD_AS_FILE_DESCRIPTION =
"""
Set to true to make your browser trigger a download instead of showing the response content by setting the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.genspectrum.lapis.openApi.LAPIS_DATA_VERSION_EXAMPLE
import org.genspectrum.lapis.openApi.LAPIS_DATA_VERSION_RESPONSE_DESCRIPTION
import org.genspectrum.lapis.openApi.LAPIS_INFO_DESCRIPTION
import org.genspectrum.lapis.openApi.REQUEST_ID_HEADER_DESCRIPTION
import org.genspectrum.lapis.openApi.REQUEST_INFO_STRING_DESCRIPTION
import org.springframework.http.ProblemDetail

data class LapisResponse<Data>(val data: Data, val info: LapisInfo = LapisInfo())
Expand All @@ -28,7 +29,7 @@ data class LapisInfo(
)
var requestId: String? = null,
@Schema(
description = "Some information about the request in human readable form. Intended for debugging.",
description = REQUEST_INFO_STRING_DESCRIPTION,
example = "my_instance on my.server.com at 2024-01-01T12:00:00.0000",
)
var requestInfo: String? = null,
Expand Down

0 comments on commit c89ef6c

Please sign in to comment.