@povio/openapi-codegen-cli 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/dist/commands/generate.d.ts +2 -1
- package/dist/generators/utils/openapi.utils.d.ts +15 -2
- package/dist/index.js +31 -31
- package/dist/sh.js +58 -58
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,14 +23,15 @@ yarn openapi-codegen generate --input http://localhost:3001/docs-json
|
|
|
23
23
|
### Generate command
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
--input <path>
|
|
27
|
-
--output <path>
|
|
28
|
-
--includeNamespaces
|
|
29
|
-
--splitByTags
|
|
30
|
-
--defaultTag
|
|
31
|
-
--excludeTags
|
|
32
|
-
--
|
|
33
|
-
--
|
|
26
|
+
--input <path> Path/url to OpenAPI/Swagger document as json/yaml
|
|
27
|
+
--output <path> Output path (default: 'output')
|
|
28
|
+
--includeNamespaces Include namespaces inside generated files (default: true)
|
|
29
|
+
--splitByTags Split output into directories based on tags in OpenAPI operations (default: true)
|
|
30
|
+
--defaultTag Default tag name for code shared accross multiple tags (default: 'Common')
|
|
31
|
+
--excludeTags Comma separated list of tags excluded from the output
|
|
32
|
+
--removeOperationPrefixEndingWith Removes prefix that ends with value from operation names (default: 'Controller_')
|
|
33
|
+
--prettier Run prettier command on output after code generation (default: true)
|
|
34
|
+
--verbose Show log messages during execution
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
## Development
|
|
@@ -5,7 +5,8 @@ export type GenerateParams = {
|
|
|
5
5
|
splitByTags: boolean;
|
|
6
6
|
defaultTag: string;
|
|
7
7
|
excludeTags: string;
|
|
8
|
+
removeOperationPrefixEndingWith: string;
|
|
8
9
|
prettier: boolean;
|
|
9
10
|
verbose: boolean;
|
|
10
11
|
};
|
|
11
|
-
export declare function generate({ input, output, includeNamespaces, splitByTags, defaultTag, excludeTags, prettier, verbose, }: GenerateParams): Promise<void>;
|
|
12
|
+
export declare function generate({ input, output, includeNamespaces, splitByTags, defaultTag, excludeTags, removeOperationPrefixEndingWith, prettier, verbose, }: GenerateParams): Promise<void>;
|
|
@@ -17,9 +17,22 @@ export declare function isParamMediaTypeAllowed(mediaType: string): mediaType is
|
|
|
17
17
|
export declare function isMainResponseStatus(status: number): boolean;
|
|
18
18
|
export declare function isErrorStatus(status: number): boolean;
|
|
19
19
|
export declare function isMediaTypeAllowed(mediaType: string): boolean;
|
|
20
|
-
export declare function getOperationName(path
|
|
20
|
+
export declare function getOperationName({ path, method, operation, options, keepOperationPrefixWithoutEnding, }: {
|
|
21
|
+
path: string;
|
|
22
|
+
method: string;
|
|
23
|
+
operation: OpenAPIV3.OperationObject;
|
|
24
|
+
options: GenerateOptions;
|
|
25
|
+
keepOperationPrefixWithoutEnding?: boolean;
|
|
26
|
+
}): string;
|
|
27
|
+
export declare function getUniqueOperationName({ path, method, operation, openApiDoc, options, }: {
|
|
28
|
+
path: string;
|
|
29
|
+
method: string;
|
|
30
|
+
operation: OpenAPIV3.OperationObject;
|
|
31
|
+
openApiDoc: OpenAPIV3.Document;
|
|
32
|
+
options: GenerateOptions;
|
|
33
|
+
}): string;
|
|
21
34
|
export declare function formatTag(tag: string): string;
|
|
22
35
|
export declare function getOperationTag(operation: OpenAPIV3.OperationObject, options: GenerateOptions): string;
|
|
23
|
-
/** @example turns `/media-objects/{id}` into `
|
|
36
|
+
/** @example turns `/media-objects/{id}` into `MediaObjectsById` */
|
|
24
37
|
export declare function pathToVariableName(path: string): string;
|
|
25
38
|
export declare function replaceHyphenatedPath(path: string): string;
|