1- import { OpenAPIV2 , OpenAPIV3 } from 'openapi-types'
2- import { expectAssignable } from 'tsd '
1+ import { type OpenAPIV2 , type OpenAPIV3 } from 'openapi-types'
2+ import { expect } from 'tstyche '
33
4- expectAssignable < OpenAPIV3 . Document > ( {
4+ expect ( {
55 openapi : '3.0.0' ,
66 info : {
77 version : '1.0.0' ,
8- title : 'Test OpenApiv3 specification' ,
8+ title : 'Test OpenApiv3 specification'
99 } ,
1010 components : {
1111 securitySchemes : {
@@ -15,16 +15,16 @@ expectAssignable<OpenAPIV3.Document>({
1515 flows : {
1616 implicit : {
1717 authorizationUrl : 'http.../login/oauth/authorize' ,
18- scopes : { } ,
19- } ,
20- } ,
21- } ,
18+ scopes : { }
19+ }
20+ }
21+ }
2222 }
2323 } ,
2424 paths : { }
25- } )
25+ } as OpenAPIV3 . Document ) . type . toBeAssignableTo < OpenAPIV3 . Document > ( )
2626
27- expectAssignable < OpenAPIV2 . Document > ( {
27+ expect ( {
2828 swagger : '2.0.0' ,
2929 info : {
3030 title : 'Test OpenApiv2 specification' ,
@@ -37,34 +37,34 @@ expectAssignable<OpenAPIV2.Document>({
3737 authorizationUrl : 'https://example.com/oauth/authorize' ,
3838 tokenUrl : 'https://example.com/oauth/token' ,
3939 'x-tokenName' : 'id_token' ,
40- scopes : { }
40+ scopes : { }
4141 } ,
4242 OAuth2ApplicationFlow : {
4343 type : 'oauth2' ,
4444 flow : 'application' ,
4545 tokenUrl : 'https://example.com/oauth/token' ,
4646 'x-tokenName' : 'id_token' ,
47- scopes : { }
47+ scopes : { }
4848 } ,
4949 OAuth2ImplicitFlow : {
5050 type : 'oauth2' ,
5151 flow : 'implicit' ,
5252 authorizationUrl : 'https://example.com/oauth/authorize' ,
5353 'x-tokenName' : 'id_token' ,
54- scopes : { }
54+ scopes : { }
5555 } ,
5656 OAuth2PasswordFlow : {
5757 type : 'oauth2' ,
5858 flow : 'password' ,
5959 tokenUrl : 'https://example.com/oauth/token' ,
6060 'x-tokenName' : 'id_token' ,
61- scopes : { }
62- } ,
61+ scopes : { }
62+ }
6363 } ,
6464 paths : { }
65- } )
65+ } as OpenAPIV2 . Document ) . type . toBeAssignableTo < OpenAPIV2 . Document > ( )
6666
67- expectAssignable < OpenAPIV2 . Document > ( {
67+ expect ( {
6868 swagger : '2.0.0' ,
6969 info : {
7070 title : 'Test OpenApiv2 specification' ,
@@ -74,8 +74,7 @@ expectAssignable<OpenAPIV2.Document>({
7474 '/users/{userId}' : {
7575 get : {
7676 summary : 'Gets a user by ID.' ,
77- responses : {
78- } ,
77+ responses : { } ,
7978 parameters : [
8079 {
8180 in : 'path' ,
@@ -89,7 +88,8 @@ expectAssignable<OpenAPIV2.Document>({
8988 in : 'query' ,
9089 name : 'offset' ,
9190 type : 'integer' ,
92- description : 'The number of items to skip before starting to collect the result set.' ,
91+ description :
92+ 'The number of items to skip before starting to collect the result set.' ,
9393 'x-example' : 1337
9494 } ,
9595 {
@@ -110,4 +110,4 @@ expectAssignable<OpenAPIV2.Document>({
110110 }
111111 }
112112 }
113- } )
113+ } as OpenAPIV2 . Document ) . type . toBeAssignableTo < OpenAPIV2 . Document > ( )
0 commit comments