Skip to content

Commit

Permalink
Fix tuple required (#82)
Browse files Browse the repository at this point in the history
* Fix: marking tuple items as required.

* Changelog: 0.11.1.
  • Loading branch information
RobinTail authored Mar 26, 2024
1 parent 2ef33b1 commit 36595f7
Show file tree
Hide file tree
Showing 5 changed files with 197 additions and 54 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Version 0

### v0.11.1

- Fix: marked tuple items as required.

### v0.11.0

- Featuring `Documentation` class:
Expand Down
31 changes: 22 additions & 9 deletions example/example-documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,19 @@ channels:
payload:
type: object
format: tuple
additionalProperties: false
properties:
"0":
type: string
description: current ISO time
required:
- "0"
additionalProperties: false
- name: chat
title: chat
messageId: out//chat
payload:
type: object
format: tuple
additionalProperties: false
properties:
"0":
type: string
Expand All @@ -96,19 +97,25 @@ channels:
required:
- from
description: extra info
required:
- "0"
- "1"
additionalProperties: false
- name: rooms
title: rooms
messageId: out//rooms
payload:
type: object
format: tuple
additionalProperties: false
properties:
"0":
type: array
items:
type: string
description: room IDs
required:
- "0"
additionalProperties: false
publish:
operationId: in/
description: The messages consumed by the application within the / namespace
Expand All @@ -120,45 +127,51 @@ channels:
payload:
type: object
format: tuple
additionalProperties: false
properties:
"0":
type: string
description: message
required:
- "0"
additionalProperties: false
- name: ping
title: ping
messageId: in//ping
payload:
type: object
format: tuple
properties: {}
required: []
additionalProperties:
format: any
description: Anything
properties: {}
bindings:
socket.io:
bindingVersion: 0.11.0
ack:
type: object
format: tuple
additionalProperties:
format: any
description: echo
properties:
"0":
type: string
enum:
- pong
description: literally
required:
- "0"
additionalProperties:
format: any
description: echo
description: Acknowledgement
- name: subscribe
title: subscribe
messageId: in//subscribe
payload:
type: object
format: tuple
properties: {}
required: []
additionalProperties:
format: any
description: Does not matter
properties: {}
components: {}
5 changes: 5 additions & 0 deletions src/__snapshots__/documentation-helpers.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,11 @@ exports[`Documentation helpers > depictTuple() > should depict as an object with
"type": "string",
},
},
"required": [
"0",
"1",
"2",
],
"type": "object",
}
`;
Expand Down
Loading

0 comments on commit 36595f7

Please sign in to comment.