Skip to content

Commit cf9ef08

Browse files
committed
feat: make dereference exclusions consistent
1 parent 33cf973 commit cf9ef08

File tree

2 files changed

+4
-61
lines changed

2 files changed

+4
-61
lines changed

src/parser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export async function parse(
5555
return (
5656
// prettier-ignore
5757
(/#\/channels\/.*\/servers/).test(path) ||
58+
(/#\/channels\/.*\/messages/).test(path) ||
5859
(/#\/operations\/.*\/channel/).test(path) ||
5960
(/#\/operations\/.*\/messages/).test(path) ||
6061
(/#\/operations\/.*\/reply\/channel/).test(path) ||

tests/lib/index.spec.ts

Lines changed: 3 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -113,26 +113,7 @@ describe('[integration testing] bundler should ', () => {
113113
'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on',
114114
messages: {
115115
turnOn: {
116-
name: 'turnOnOff',
117-
title: 'Turn on/off',
118-
summary:
119-
'Command a particular streetlight to turn the lights on or off.',
120-
payload: {
121-
$schema: 'https://json-schema.org/draft/2020-12/schema',
122-
type: 'object',
123-
properties: {
124-
command: {
125-
type: 'string',
126-
enum: ['on', 'off'],
127-
description: 'Whether to turn on or off the light.',
128-
},
129-
sentAt: {
130-
type: 'string',
131-
format: 'date-time',
132-
description: 'Date and time when the message was sent.',
133-
},
134-
},
135-
},
116+
$ref: '#/components/messages/turnOnOff',
136117
},
137118
},
138119
},
@@ -141,26 +122,7 @@ describe('[integration testing] bundler should ', () => {
141122
'smartylighting/streetlights/1/0/action/{streetlightId}/turn/off',
142123
messages: {
143124
turnOff: {
144-
name: 'turnOnOff',
145-
title: 'Turn on/off',
146-
summary:
147-
'Command a particular streetlight to turn the lights on or off.',
148-
payload: {
149-
$schema: 'https://json-schema.org/draft/2020-12/schema',
150-
type: 'object',
151-
properties: {
152-
command: {
153-
type: 'string',
154-
enum: ['on', 'off'],
155-
description: 'Whether to turn on or off the light.',
156-
},
157-
sentAt: {
158-
type: 'string',
159-
format: 'date-time',
160-
description: 'Date and time when the message was sent.',
161-
},
162-
},
163-
},
125+
$ref: '#/components/messages/turnOnOff',
164126
},
165127
},
166128
},
@@ -169,27 +131,7 @@ describe('[integration testing] bundler should ', () => {
169131
'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured',
170132
messages: {
171133
lightMeasured: {
172-
name: 'lightMeasured',
173-
title: 'Light measured',
174-
summary:
175-
'Inform about environmental lighting conditions of a particular streetlight.',
176-
contentType: 'application/json',
177-
payload: {
178-
$schema: 'https://json-schema.org/draft/2020-12/schema',
179-
type: 'object',
180-
properties: {
181-
lumens: {
182-
type: 'integer',
183-
minimum: 0,
184-
description: 'Light intensity measured in lumens.',
185-
},
186-
sentAt: {
187-
type: 'string',
188-
format: 'date-time',
189-
description: 'Date and time when the message was sent.',
190-
},
191-
},
192-
},
134+
$ref: '#/components/messages/lightMeasured',
193135
},
194136
},
195137
description:

0 commit comments

Comments
 (0)