Product Guide

ReadMe Documentation

Welcome to the ReadMe Documentation, where you'll find comprehensive guides and community support to help you start working with ReadMe as quickly as possible!

Get Started
Ask A Question

Questions

5
ANSWERED

Swagger oas: expected Object { $ref: '' } to have property description

Anyone see anything wrong with this? Trying to generate swagger.json with marked up Nodejs code. ``` const autoBind = require('../util/autobind'); /** * @oas * components: * schemas: * organization: * type: object * properties: * id: * type: string * name: * type: string * baseUrl: * type: string * type: * type: string * status: * type: string * creationDate: * type: date * expirationDate: * type: date * stats: * type: string * responseCounts: * type: int * auditable: * type: int * generated: * type: int * deleted: * type: int * surveyCounts: * type: int * totalSurveys: * type: int * activeSurveys: * type: int * loginActivity: * type: string * totalUsers: * type: string * past1Days: * type: int * past7Days: * type: int * past14Days: * type: int * past30Days: * type: int * past60Days: * type: int * past90Days: * type: int * past120Days: * type: int * ever: * type: int * never: * type: int */ class Organizations { constructor(http) { this.http = http; autoBind(this); } /* * @oas [get] /organizations/{organizationId} * description: Returns Organization details * parameters: * - (path) organizationId {String} Organization ID aka Brand * - (header) X-API-TOKEN {String} API Token * responses: * 200: * description: success * 401: * description: you must be brand administrator or API Key is invalid * schema: * $ref: ''#/components/schema/organization */ getOrganization(organizationId) { return this.http.get(`/organizations/${organizationId}`); } } module.exports = Organizations; ``` Here is error from *oas generate -v* ``` { "openapi": "3.0.0", "x-api-id": "qualtrics-sdk-node", "info": { "version": "3.7.0", "title": "qualtrics-sdk-node", "license": { "name": "Apache-2.0" } }, "servers": [ { "url": "https://co1.qualtrics.com/API/v3" } ], "paths": { "/organizations/{organizationId}": { "get": { "description": "Returns Organization details", "parameters": [ { "in": "path", "name": "organizationId", "required": true, "description": "Organization ID aka Brand", "schema": { "type": "string" } }, { "in": "header", "name": "X-API-TOKEN", "description": "API Token", "schema": { "type": "string" } } ], "responses": { "200": { "description": "success" }, "401": { "description": "you must be brand administrator or API Key is invalid" }, "schema": { "$ref": "" } } } } }, "x-si-base": "/home/walker/Documents/qualtrics-sdk-node/swagger.json" } ``` Error validating Swagger! ✖ expected Object { $ref: '' } to have property description

Posted by Walker Rowe 2 years ago