diff --git a/src/__snapshots__/basic.test.ts.snap b/src/__snapshots__/basic.test.ts.snap index d4cefb2..f68dcac 100644 --- a/src/__snapshots__/basic.test.ts.snap +++ b/src/__snapshots__/basic.test.ts.snap @@ -14,7 +14,7 @@ exports[`basic openapi project renders description 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -43,7 +43,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "type": "string", "foo": "string" @@ -89,7 +89,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "type": "string", "bar": "string" diff --git a/src/__snapshots__/combiners/allOf.test.ts.snap b/src/__snapshots__/combiners/allOf.test.ts.snap index f69a3f9..ebdcd3b 100644 --- a/src/__snapshots__/combiners/allOf.test.ts.snap +++ b/src/__snapshots__/combiners/allOf.test.ts.snap @@ -14,7 +14,7 @@ exports[`allOf operator support renders simple allOf 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -35,7 +35,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "type": "string", "foo": "string", @@ -88,7 +88,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "type": "string", "baz": "string" @@ -154,7 +154,7 @@ exports[`allOf operator support renders single allOf 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -175,7 +175,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "pet": { "type": "string", @@ -245,7 +245,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "pet": { "type": "string", diff --git a/src/__snapshots__/combiners/complex.test.ts.snap b/src/__snapshots__/combiners/complex.test.ts.snap index 2e8538c..da1f020 100644 --- a/src/__snapshots__/combiners/complex.test.ts.snap +++ b/src/__snapshots__/combiners/complex.test.ts.snap @@ -14,7 +14,7 @@ exports[`operators complex test renders ok 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -35,7 +35,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "name": "b", "age": { @@ -158,7 +158,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "name": "b", "age": { diff --git a/src/__snapshots__/combiners/oneOf.test.ts.snap b/src/__snapshots__/combiners/oneOf.test.ts.snap index cc5b75f..8cb5cae 100644 --- a/src/__snapshots__/combiners/oneOf.test.ts.snap +++ b/src/__snapshots__/combiners/oneOf.test.ts.snap @@ -14,7 +14,7 @@ exports[`oneOf operator support renders empty 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -35,7 +35,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "type": "string", "baz": "string" @@ -135,7 +135,7 @@ Cat class {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "type": "string", "baz": "string" @@ -194,7 +194,7 @@ exports[`oneOf operator support renders filled 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -215,7 +215,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "name": "string", "age": 0, @@ -329,7 +329,7 @@ Cat class {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "name": "string", "age": 0, @@ -402,7 +402,7 @@ exports[`oneOf operator support renders parameter 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -423,7 +423,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "pet": { "type": "string", @@ -534,7 +534,7 @@ Cat class {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "pet": { "type": "string", diff --git a/src/__snapshots__/constraints/default.test.ts.snap b/src/__snapshots__/constraints/default.test.ts.snap index 4f78392..783821a 100644 --- a/src/__snapshots__/constraints/default.test.ts.snap +++ b/src/__snapshots__/constraints/default.test.ts.snap @@ -14,7 +14,7 @@ exports[`Default value constraints should process default constraints specified
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -60,7 +60,7 @@ Amount of search results to show
{% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` @@ -94,7 +94,7 @@ exports[`Default value constraints should process default constraints specified
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -115,7 +115,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "role": "basic", "name": "Anonymous", @@ -197,7 +197,7 @@ Role for the user being created {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` diff --git a/src/__snapshots__/constraints/length.test.ts.snap b/src/__snapshots__/constraints/length.test.ts.snap index af78705..d151799 100644 --- a/src/__snapshots__/constraints/length.test.ts.snap +++ b/src/__snapshots__/constraints/length.test.ts.snap @@ -14,7 +14,7 @@ exports[`length renders correct length limits 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -41,7 +41,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "pet": { "name": "string", diff --git a/src/__snapshots__/description.test.ts.snap b/src/__snapshots__/description.test.ts.snap index 7d85bea..fddfba1 100644 --- a/src/__snapshots__/description.test.ts.snap +++ b/src/__snapshots__/description.test.ts.snap @@ -14,7 +14,7 @@ exports[`description renders correct description 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -41,7 +41,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "pet": { "type": "string", diff --git a/src/__snapshots__/examples/array.test.ts.snap b/src/__snapshots__/examples/array.test.ts.snap index 8d8cc51..9e64042 100644 --- a/src/__snapshots__/examples/array.test.ts.snap +++ b/src/__snapshots__/examples/array.test.ts.snap @@ -14,7 +14,7 @@ exports[`openapi project with examples renders array + allOf example 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -35,7 +35,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "a": [ { @@ -79,7 +79,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` @@ -113,7 +113,7 @@ exports[`openapi project with examples renders array + oneOf + allOf example 1`]
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -134,7 +134,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "a": [ { @@ -180,7 +180,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` @@ -214,7 +214,7 @@ exports[`openapi project with examples renders array + oneOf example 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -235,7 +235,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "a": [ "s", @@ -278,7 +278,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` @@ -312,7 +312,7 @@ exports[`openapi project with examples renders example field 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -333,7 +333,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no [ { "test": 1 @@ -367,7 +367,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` @@ -401,7 +401,7 @@ exports[`openapi project with examples renders infered example 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -422,7 +422,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no [ { "name": "string" @@ -471,7 +471,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` @@ -505,7 +505,7 @@ exports[`openapi project with examples renders nested arrays exmaple 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -526,7 +526,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no [ [ { @@ -577,7 +577,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` diff --git a/src/__snapshots__/examples/base.test.ts.snap b/src/__snapshots__/examples/base.test.ts.snap index c7ab0aa..631681a 100644 --- a/src/__snapshots__/examples/base.test.ts.snap +++ b/src/__snapshots__/examples/base.test.ts.snap @@ -14,7 +14,7 @@ exports[`openapi project with examples renders example field 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -35,7 +35,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "name": "Example" } @@ -62,7 +62,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` @@ -96,7 +96,7 @@ exports[`openapi project with examples renders example from allOf 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -117,7 +117,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "name": "string" } @@ -156,7 +156,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` @@ -190,7 +190,7 @@ exports[`openapi project with examples renders example from oneOf 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -211,7 +211,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "name": "string" } @@ -268,7 +268,7 @@ Base 200 response {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` diff --git a/src/__snapshots__/hidden/endpointParameters.test.ts.snap b/src/__snapshots__/hidden/endpointParameters.test.ts.snap index 36194ae..be5f7ea 100644 --- a/src/__snapshots__/hidden/endpointParameters.test.ts.snap +++ b/src/__snapshots__/hidden/endpointParameters.test.ts.snap @@ -14,7 +14,7 @@ exports[`Endpoint parameter tables should be omitted if all of their respective
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -57,7 +57,7 @@ Access token {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` @@ -91,7 +91,7 @@ exports[`Endpoint parameter tables should not include parameters marked with \`x
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -134,7 +134,7 @@ Name for the requested star {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` diff --git a/src/__snapshots__/hidden/objectProps.test.ts.snap b/src/__snapshots__/hidden/objectProps.test.ts.snap index d5889ed..9faf440 100644 --- a/src/__snapshots__/hidden/objectProps.test.ts.snap +++ b/src/__snapshots__/hidden/objectProps.test.ts.snap @@ -14,7 +14,7 @@ exports[`Properties in object schemas marked with \`x-hidden\` should not be ren
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -35,7 +35,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "luminosityClass": "string", "name": "string" @@ -83,7 +83,7 @@ Name of this star {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` diff --git a/src/__snapshots__/objectPropertyOrder.test.ts.snap b/src/__snapshots__/objectPropertyOrder.test.ts.snap index f26edf8..8a64d34 100644 --- a/src/__snapshots__/objectPropertyOrder.test.ts.snap +++ b/src/__snapshots__/objectPropertyOrder.test.ts.snap @@ -14,7 +14,7 @@ exports[`Property rows in tables describing object schemas are hoisted to the to
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -35,7 +35,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "id": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b", "luminosityClass": "string", @@ -101,7 +101,7 @@ CCDM catalogue designation for this star {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` @@ -135,7 +135,7 @@ exports[`Property rows in tables describing object schemas are ordered lexicogra
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -156,7 +156,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "id": "c3073b9d-edd0-49f2-a28d-b7ded8ff9a8b", "luminosityClass": "string", @@ -222,7 +222,7 @@ Name of this star {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` diff --git a/src/__snapshots__/parameterOrder.test.ts.snap b/src/__snapshots__/parameterOrder.test.ts.snap index 392be54..6c8fec8 100644 --- a/src/__snapshots__/parameterOrder.test.ts.snap +++ b/src/__snapshots__/parameterOrder.test.ts.snap @@ -14,7 +14,7 @@ exports[`Endpoint parameters in tables are hoisted to the top of the table if ma
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -73,7 +73,7 @@ Name for the requested star {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` @@ -107,7 +107,7 @@ exports[`Endpoint parameters in tables are ordered lexicographically by default
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -166,7 +166,7 @@ Name for the requested star {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no {} \`\`\` diff --git a/src/__snapshots__/recursiveReferences.test.ts.snap b/src/__snapshots__/recursiveReferences.test.ts.snap index 9551507..aba58ed 100644 --- a/src/__snapshots__/recursiveReferences.test.ts.snap +++ b/src/__snapshots__/recursiveReferences.test.ts.snap @@ -14,7 +14,7 @@ exports[`Recursive references in schemas resulting in a cycle between two compon
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -41,7 +41,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "A": { "B": {} @@ -127,7 +127,7 @@ exports[`Recursive references in schemas resulting in a trivial self-referential
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -154,7 +154,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "A": {} } @@ -220,7 +220,7 @@ exports[`Recursive references in schemas where the cycle itself is not trivially
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -247,7 +247,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "A": {} } diff --git a/src/__snapshots__/required.test.ts.snap b/src/__snapshots__/required.test.ts.snap index 46512ea..bc39822 100644 --- a/src/__snapshots__/required.test.ts.snap +++ b/src/__snapshots__/required.test.ts.snap @@ -14,7 +14,7 @@ exports[`required renders correct required 1`] = `
POST {.openapi__method} -\`\`\` +\`\`\`text translate=no http://localhost:8080/test \`\`\` @@ -61,7 +61,7 @@ Generated server url {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "d": 0, "e": 0 @@ -125,7 +125,7 @@ Cat class {% cut "application/json" %} -\`\`\`json +\`\`\`json translate=no { "type": "string", "foo": "string" diff --git a/src/includer/ui/common.ts b/src/includer/ui/common.ts index e4820d0..65c68c3 100644 --- a/src/includer/ui/common.ts +++ b/src/includer/ui/common.ts @@ -50,7 +50,11 @@ function bold(text: string) { function code(text: string, type = 'text', translate = false) { const appliedType = type && text.length <= 2000 ? type : 'text'; - return EOL + ['```' + appliedType + ` ${translate ? '' : 'translate=no'}`, text, '```'].join(EOL) + EOL; + return ( + EOL + + ['```' + appliedType + ` ${translate ? '' : 'translate=no'}`, text, '```'].join(EOL) + + EOL + ); } function method(text: string, path: string, server: V3Server) {