Skip to content

Commit

Permalink
feat(sdk): type nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Sep 7, 2022
1 parent 21c579a commit fe70395
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 1 deletion.
1 change: 0 additions & 1 deletion .schema/openapi/patches/common.yaml
Expand Up @@ -6,4 +6,3 @@
path: /components/schemas/genericError/properties/details/type
- op: remove
path: /components/schemas/genericError/properties/details/additionalProperties

43 changes: 43 additions & 0 deletions .schema/openapi/patches/nulls.yaml
@@ -0,0 +1,43 @@
- op: replace
path: "#/components/schemas/NullUUID"
value:
type: string
format: uuid4
nullable: true
- op: replace
path: "#/components/schemas/NullTime"
value:
format: date-time
type: string
nullable: true
- op: replace
path: "#/components/schemas/Time"
value:
format: date-time
type: string
- op: replace
path: "#/components/schemas/NullString"
value:
type: string
nullable: true
- op: replace
path: "#/components/schemas/NullBool"
value:
type: boolean
nullable: true
- op: replace
path: "#/components/schemas/NullInt"
value:
type: integer
nullable: true
- op: replace
path: "#/components/schemas/nullInt64"
value:
type: integer
nullable: true
- op: replace
path: "#/components/schemas/nullDuration"
value:
type: string
nullable: true
pattern: ^[0-9]+(ns|us|ms|s|m|h)$
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -120,6 +120,7 @@ sdk: .bin/swagger .bin/ory node_modules
-p file://.schema/openapi/patches/meta.yaml \
-p file://.schema/openapi/patches/health.yaml \
-p file://.schema/openapi/patches/oauth2.yaml \
-p file://.schema/openapi/patches/nulls.yaml \
-p file://.schema/openapi/patches/common.yaml \
-p file://.schema/openapi/patches/security.yaml \
spec/swagger.json spec/api.json
Expand Down
27 changes: 27 additions & 0 deletions internal/httpclient/api/openapi.yaml
Expand Up @@ -1692,12 +1692,32 @@ components:
\ SQL, and Swagger."
JoseJSONWebKeySet:
type: object
NullBool:
nullable: true
type: boolean
NullInt:
nullable: true
type: integer
NullString:
nullable: true
type: string
NullTime:
format: date-time
nullable: true
type: string
NullUUID:
format: uuid4
nullable: true
type: string
StringSliceJSONFormat:
items:
type: string
title: "StringSliceJSONFormat represents []string{} which is encoded to/from\
\ JSON for SQL storage."
type: array
Time:
format: date-time
type: string
UUID:
format: uuid4
type: string
Expand Down Expand Up @@ -2261,6 +2281,13 @@ components:
$ref: '#/components/schemas/jsonWebKey'
type: array
type: object
nullDuration:
nullable: true
pattern: "^[0-9]+(ns|us|ms|s|m|h)$"
type: string
nullInt64:
nullable: true
type: integer
nullTime:
format: date-time
title: NullTime implements sql.NullTime functionality.
Expand Down
35 changes: 35 additions & 0 deletions spec/api.json
Expand Up @@ -25,13 +25,39 @@
"JoseJSONWebKeySet": {
"type": "object"
},
"NullBool": {
"nullable": true,
"type": "boolean"
},
"NullInt": {
"nullable": true,
"type": "integer"
},
"NullString": {
"nullable": true,
"type": "string"
},
"NullTime": {
"format": "date-time",
"nullable": true,
"type": "string"
},
"NullUUID": {
"format": "uuid4",
"nullable": true,
"type": "string"
},
"StringSliceJSONFormat": {
"items": {
"type": "string"
},
"title": "StringSliceJSONFormat represents []string{} which is encoded to/from JSON for SQL storage.",
"type": "array"
},
"Time": {
"format": "date-time",
"type": "string"
},
"UUID": {
"format": "uuid4",
"type": "string"
Expand Down Expand Up @@ -490,6 +516,15 @@
},
"type": "object"
},
"nullDuration": {
"nullable": true,
"pattern": "^[0-9]+(ns|us|ms|s|m|h)$",
"type": "string"
},
"nullInt64": {
"nullable": true,
"type": "integer"
},
"nullTime": {
"format": "date-time",
"title": "NullTime implements sql.NullTime functionality.",
Expand Down

0 comments on commit fe70395

Please sign in to comment.