Skip to content

Commit 665b979

Browse files
committed
chore: fix documentation generation, fail on warnings
1 parent f4783ed commit 665b979

File tree

5 files changed

+53
-2
lines changed

5 files changed

+53
-2
lines changed

docs/interfaces/openapi_client.OpenApiClientGeneratorConfigClient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ ___
123123

124124
### generateErrorJsDoc
125125

126-
`Optional` **generateErrorJsDoc**: `GenerateClientErrorJsDoc`
126+
`Optional` **generateErrorJsDoc**: [`GenerateClientErrorJsDoc`](../modules/openapi_client.md#generateclienterrorjsdoc)
127127

128128
Client error class JSDoc generation callback.
129129

docs/modules/openapi_client.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
- [CommonHttpClientFetchResponseBody](openapi_client.md#commonhttpclientfetchresponsebody)
3737
- [CommonHttpClientRequest](openapi_client.md#commonhttpclientrequest)
3838
- [CommonHttpClientResponseHeaders](openapi_client.md#commonhttpclientresponseheaders)
39+
- [GenerateClientErrorJsDoc](openapi_client.md#generateclienterrorjsdoc)
3940
- [GenerateClientJsDoc](openapi_client.md#generateclientjsdoc)
4041
- [GenerateModelJsDoc](openapi_client.md#generatemodeljsdoc)
4142
- [GenerateModelNameCallback](openapi_client.md#generatemodelnamecallback)
@@ -74,6 +75,41 @@ ___
7475

7576
___
7677

78+
### GenerateClientErrorJsDoc
79+
80+
Ƭ **GenerateClientErrorJsDoc**: (`params`: \{ `info`: [`OpenApiInfo`](../interfaces/openapi.OpenApiInfo.md) ; `suggestedJsDoc`: [`JsDocBlock`](../interfaces/index.JsDocBlock.md) }) => [`JsDocBlock`](../interfaces/index.JsDocBlock.md)
81+
82+
#### Type declaration
83+
84+
▸ (`params`): [`JsDocBlock`](../interfaces/index.JsDocBlock.md)
85+
86+
Callback for generating the JSDoc of a client.
87+
88+
##### Parameters
89+
90+
| Name | Type | Description |
91+
| :------ | :------ | :------ |
92+
| `params` | `Object` | - |
93+
| `params.info` | [`OpenApiInfo`](../interfaces/openapi.OpenApiInfo.md) | OpenAPI Info Object. |
94+
| `params.suggestedJsDoc` | [`JsDocBlock`](../interfaces/index.JsDocBlock.md) | Suggested JSDoc block. Used by default if the callback is not specified. |
95+
96+
##### Returns
97+
98+
[`JsDocBlock`](../interfaces/index.JsDocBlock.md)
99+
100+
**`Example`**
101+
102+
```ts
103+
function generateClientErrorJsDoc({suggestedJsDoc, info}) {
104+
return {
105+
...suggestedJsDoc,
106+
title: 'Error Class for ' + info.summary
107+
};
108+
}
109+
```
110+
111+
___
112+
77113
### GenerateClientJsDoc
78114

79115
Ƭ **GenerateClientJsDoc**: (`params`: \{ `info`: [`OpenApiInfo`](../interfaces/openapi.OpenApiInfo.md) ; `suggestedJsDoc`: [`JsDocBlock`](../interfaces/index.JsDocBlock.md) }) => [`JsDocBlock`](../interfaces/index.JsDocBlock.md)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"scripts": {
4040
"precheck": "tsc --noEmit && jest && ",
4141
"build": "rimraf lib && tsc -p tsconfig.build.json && cp -R src/schema-to-typescript/common/core/* lib/schema-to-typescript/common/core && cp -R src/schema-to-typescript/common/validation-providers/zod-validation-provider/*-*.ts lib/schema-to-typescript/common/validation-providers/zod-validation-provider",
42-
"build:docs": "rm -Rf docs && typedoc --exclude test --excludeInternal --excludeExternals --disableSources --plugin typedoc-plugin-markdown --entryDocument ../README.md --out docs src/index.ts src/openapi.ts src/openapi-client.ts && ts-node tools/cleanup-docs.ts",
42+
"build:docs": "rm -Rf docs && typedoc && ts-node tools/cleanup-docs.ts",
4343
"prepublishOnly": "npm run build",
4444
"lint": "eslint {src,test,tools}/**/*.ts",
4545
"lint:fix": "eslint --fix {src,test,tools}/**/*.ts",

src/openapi-client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type {
1212
GenerateOperationResultDescription,
1313
GenerateServiceJsDoc,
1414
GenerateClientJsDoc,
15+
GenerateClientErrorJsDoc,
1516
OpenApiClientBuiltinBinaryType,
1617
OpenApiClientCustomizableBinaryType,
1718
OpenApiClientExternalType,

typedoc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://typedoc.org/schema.json",
3+
"plugin": [
4+
"typedoc-plugin-markdown"
5+
],
6+
"entryPoints": ["src/index.ts", "src/openapi.ts", "src/openapi-client.ts"],
7+
"exclude": ["test"],
8+
"excludeExternals": true,
9+
"excludeInternal": true,
10+
"disableSources": true,
11+
"entryDocument": "../README.md",
12+
"out": "docs",
13+
"treatWarningsAsErrors": true
14+
}

0 commit comments

Comments
 (0)