Fix schema type of AsyncAPI operation tags (#1339)

* fix: Schema type of AsyncAPI operation tags

* add tests

* test: Expand tags test for AsyncAPI

---------

Co-authored-by: Lorna Mitchell <lorna.mitchell@redocly.com>
This commit is contained in:
Sergey Shishkin
2023-12-28 13:52:35 +02:00
committed by GitHub
parent 918f570203
commit b4c1274b37
5 changed files with 44 additions and 8 deletions

View File

@@ -0,0 +1,5 @@
---
"@redocly/openapi-core": patch
---
Fix schema type of AsyncAPI operation tags

View File

@@ -0,0 +1,32 @@
asyncapi: '2.6.0'
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signups
channels:
user/signedup:
subscribe:
message:
$ref: '#/components/messages/UserSignedUp'
tags:
- name: user
- name: signup
description: Tag descriptions are supported
- name: register
description: Tag descriptions and external docs are supported
externalDocs:
url: https://redocly.com/docs
description: Some excellent docs
components:
messages:
UserSignedUp:
payload:
type: object
properties:
displayName:
type: string
description: Name of the user
email:
type: string
format: email
description: Email of the user

View File

@@ -15,6 +15,8 @@ apis:
root: ./oneof.yml
operation-security:
root: ./operation-security.yml
operation-with-tags:
root: ./operation-with-tags.yml
rpc-client:
root: ./rpc-client.yml
rpc-server:

View File

@@ -26,6 +26,9 @@ validating /oneof.yml...
validating /operation-security.yml...
/operation-security.yml: validated in <test>ms
validating /operation-with-tags.yml...
/operation-with-tags.yml: validated in <test>ms
validating /rpc-client.yml...
/rpc-client.yml: validated in <test>ms

View File

@@ -274,10 +274,7 @@ const OperationBindings: NodeType = {
const OperationTrait: NodeType = {
properties: {
tags: {
type: 'array',
items: { type: 'string' },
},
tags: 'TagList',
summary: { type: 'string' },
description: { type: 'string' },
externalDocs: 'ExternalDocs',
@@ -311,10 +308,7 @@ const MessageTrait: NodeType = {
const Operation: NodeType = {
properties: {
tags: {
type: 'array',
items: { type: 'string' },
},
tags: 'TagList',
summary: { type: 'string' },
description: { type: 'string' },
externalDocs: 'ExternalDocs',