Skip to content

Commit 1e29431

Browse files
johngeorgewrightForbesLindesay
authored andcommitted
fix: 🐛 remove unused import declaration (#9)
* fix: 🐛 remove unused import declaration * chore: 🤖 change circle ci so it'll build my branch
1 parent f8d0277 commit 1e29431

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

.circleci/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ workflows:
5555
all:
5656
jobs:
5757
- test:
58-
context: common-env
5958
filters:
6059
branches:
6160
ignore:
@@ -77,4 +76,4 @@ workflows:
7776
only: master
7877
jobs:
7978
- test:
80-
context: common-env
79+
context: common-env

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ Usage: typescript-json-schema <path-to-typescript-file> <type>
5353
Options:
5454
--help Show help [boolean]
5555
--version Show version number [boolean]
56-
--collection Process the file as a collection of types, instead of
57-
one single type. [boolean] [default: false]
5856
--refs Create shared ref definitions. [boolean] [default: true]
5957
--aliasRefs Create shared ref definitions for the type aliases.
6058
[boolean] [default: false]
@@ -87,6 +85,24 @@ Options:
8785
--rejectDateType Rejects Date fields in type definitions.
8886
[boolean] [default: false]
8987
--id ID of schema. [string] [default: ""]
88+
--uniqueItems Validate `uniqueItems` keyword [boolean] [default: true]
89+
--unicode calculate correct length of strings with unicode pairs
90+
(true by default). Pass false to use .length of strings
91+
that is faster, but gives "incorrect" lengths of strings
92+
with unicode pairs - each unicode pair is counted as two
93+
characters. [boolean] [default: true]
94+
--nullable support keyword "nullable" from Open API 3
95+
specification. [boolean] [default: true]
96+
--format formats validation mode ('fast' by default). Pass 'full'
97+
for more correct and slow validation or false not to
98+
validate formats at all. E.g., 25:00:00 and 2015/14/33
99+
will be invalid time and date in 'full' mode but it will
100+
be valid in 'fast' mode.
101+
[choices: "fast", "full"] [default: "fast"]
102+
--coerceTypes Change data type of data to match type keyword. e.g.
103+
parse numbers in strings [boolean] [default: false]
104+
--collection Process the file as a collection of types, instead of
105+
one single type. [boolean] [default: false]
90106
--useNamedExport Type name is a named export, rather than the default
91107
export of the file [boolean] [default: false]
92108
-* [default: []]

src/__tests__/output/ComplexExample.valiator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {inspect} from 'util';
21
import Ajv = require('ajv');
32
import {Context} from 'koa';
3+
import {inspect} from 'util';
44
import {MyEnum, TypeA, TypeB, RequestA, RequestB} from '../../ComplexExample';
55
export const ajv = new Ajv({allErrors: true, coerceTypes: false});
66

src/printValidator.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ export function printTypeCollectionValidator(
2323
return isKoaType(schema.definitions && schema.definitions[typeName]);
2424
});
2525
return [
26-
t.IMPORT_INSPECT,
2726
t.IMPORT_AJV,
28-
...(koaTypes.length ? [t.IMPORT_KOA_CONTEXT] : []),
27+
...(koaTypes.length ? [t.IMPORT_KOA_CONTEXT, t.IMPORT_INSPECT] : []),
2928
t.importNamedTypes(symbols, relativePath),
3029
t.declareAJV(options),
3130
t.exportNamed(symbols),

0 commit comments

Comments
 (0)