Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7860516
open-api-types.ts
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
open-api-types.ts
View Options
// adapted from drf-spectacular :3
export
enum
OpenApiTypes
{
NUMBER
,
FLOAT
,
DOUBLE
,
BOOL
,
STR
,
BYTE
,
BINARY
,
PASSWORD
,
INT
,
INT32
,
INT64
,
UUID
,
URI
,
URI_REF
,
URI_TPL
,
IRI
,
IRI_REF
,
IP4
,
IP6
,
HOSTNAME
,
IDN_HOSTNAME
,
DECIMAL
,
DATETIME
,
DATE
,
TIME
,
DURATION
,
EMAIL
,
IDN_EMAIL
,
JSON_PTR
,
JSON_PTR_REL
,
REGEX
,
ANY
,
NONE
,
OBJECT
,
}
interface
OpenApiTypeInfo
{
type
?:
string
;
format
?:
string
;
}
export
const
OpenApiTypeMapping
:
Record
<
OpenApiTypes
,
OpenApiTypeInfo
|
null
>
=
{
[
OpenApiTypes
.
NUMBER
]
:
{
type
:
"number"
},
[
OpenApiTypes
.
FLOAT
]
:
{
type
:
"number"
,
format
:
"float"
},
[
OpenApiTypes
.
DOUBLE
]
:
{
type
:
"number"
,
format
:
"double"
},
[
OpenApiTypes
.
BOOL
]
:
{
type
:
"boolean"
},
[
OpenApiTypes
.
STR
]
:
{
type
:
"string"
},
[
OpenApiTypes
.
BYTE
]
:
{
type
:
"string"
,
format
:
"byte"
},
[
OpenApiTypes
.
BINARY
]
:
{
type
:
"string"
,
format
:
"binary"
},
[
OpenApiTypes
.
PASSWORD
]
:
{
type
:
"string"
,
format
:
"password"
},
[
OpenApiTypes
.
INT
]
:
{
type
:
"integer"
},
[
OpenApiTypes
.
INT32
]
:
{
type
:
"integer"
,
format
:
"int32"
},
[
OpenApiTypes
.
INT64
]
:
{
type
:
"integer"
,
format
:
"int64"
},
[
OpenApiTypes
.
UUID
]
:
{
type
:
"string"
,
format
:
"uuid"
},
[
OpenApiTypes
.
URI
]
:
{
type
:
"string"
,
format
:
"uri"
},
[
OpenApiTypes
.
URI_REF
]
:
{
type
:
"string"
,
format
:
"uri-reference"
},
[
OpenApiTypes
.
URI_TPL
]
:
{
type
:
"string"
,
format
:
"uri-template"
},
[
OpenApiTypes
.
IRI
]
:
{
type
:
"string"
,
format
:
"iri"
},
[
OpenApiTypes
.
IRI_REF
]
:
{
type
:
"string"
,
format
:
"iri-reference"
},
[
OpenApiTypes
.
IP4
]
:
{
type
:
"string"
,
format
:
"ipv4"
},
[
OpenApiTypes
.
IP6
]
:
{
type
:
"string"
,
format
:
"ipv6"
},
[
OpenApiTypes
.
HOSTNAME
]
:
{
type
:
"string"
,
format
:
"hostname"
},
[
OpenApiTypes
.
IDN_HOSTNAME
]
:
{
type
:
"string"
,
format
:
"idn-hostname"
},
[
OpenApiTypes
.
DECIMAL
]
:
{
type
:
"number"
,
format
:
"double"
},
[
OpenApiTypes
.
DATETIME
]
:
{
type
:
"string"
,
format
:
"date-time"
},
[
OpenApiTypes
.
DATE
]
:
{
type
:
"string"
,
format
:
"date"
},
[
OpenApiTypes
.
TIME
]
:
{
type
:
"string"
,
format
:
"time"
},
[
OpenApiTypes
.
DURATION
]
:
{
type
:
"string"
,
format
:
"duration"
},
[
OpenApiTypes
.
EMAIL
]
:
{
type
:
"string"
,
format
:
"email"
},
[
OpenApiTypes
.
IDN_EMAIL
]
:
{
type
:
"string"
,
format
:
"idn-email"
},
[
OpenApiTypes
.
JSON_PTR
]
:
{
type
:
"string"
,
format
:
"json-pointer"
},
[
OpenApiTypes
.
JSON_PTR_REL
]
:
{
type
:
"string"
,
format
:
"relative-json-pointer"
,
},
[
OpenApiTypes
.
REGEX
]
:
{
type
:
"string"
,
format
:
"regex"
},
[
OpenApiTypes
.
ANY
]
:
{},
[
OpenApiTypes
.
NONE
]
:
null
,
[
OpenApiTypes
.
OBJECT
]
:
{
type
:
"object"
},
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 13, 18:04 (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
876873
Default Alt Text
open-api-types.ts (2 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment