From 88c7b8a66448e08e42512bbd204ca4d45181a0f8 Mon Sep 17 00:00:00 2001 From: George Thomas Date: Thu, 2 Feb 2023 15:23:39 +0000 Subject: [PATCH] docs: Document limitations of OpenAPI inlined type schemas workaround --- primer-service/src/Primer/Server.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/primer-service/src/Primer/Server.hs b/primer-service/src/Primer/Server.hs index 7cef7fe14..bfcb0f300 100644 --- a/primer-service/src/Primer/Server.hs +++ b/primer-service/src/Primer/Server.hs @@ -127,6 +127,10 @@ openAPIInfo = Given a type, and some query parameters of that type, this ensures that the specification of each parameter references a common schema, instead of inlining it. + This could be made more general, (visit non-POST endpoints, + modify `show . typeRep` output when it contains `'` to match `openapi3`, + search by schema shape so that we don't have to manually enumerate use sites), + but _hopefully_ this will just be fixed upstream before we have to worry about any of that. -} refParamSchemas :: forall a. ToSchema a => [(FilePath, Text)] -> OpenApi -> OpenApi refParamSchemas params api =