oas-tools / oas-commons Goto Github PK
View Code? Open in Web Editor NEWUtility library for the development of new features and modules for oas-tools project
License: Apache License 2.0
Utility library for the development of new features and modules for oas-tools project
License: Apache License 2.0
Hello,
First of all, thanks for the great library ๐
The oas-tools validator fails with an obscure message when the field "description" is missing in any "responses" field of the API document.
[oas-tools] ERROR: TypeError: s.replaceAll is not a function
Steps to reproduce the behavior:
openapi: "3.1.0"
info:
version: 1.0.0
title: Sample API
servers:
- url: http://localhost:9876
paths:
/test:
x-router-controller: controller
get:
operationId: test
responses:
200:
description: Sample description # <--- Line to remove
content:
application/json:
schema:
type: object
npm start
. No error appears2022-09-24 18:09:83 [oas-tools] ERROR: TypeError: s.replaceAll is not a function
at _____\node_modules\@oas-tools\commons\dist\utils\modules\validator.js:40:131
The validator should ignore the missing field, or give a clearer message about the missing field
According to the OAS spec, the description field is optional:
Operations also support some optional elements for documentation purposes:
- A short summary and a longer description of what an operation does. description can be multi-line and supports Markdown for rich text representation.
- ...
The content of index.d.ts
is broken in the @oas-tools/commons v1.0.1 module:
node_modules/@oas-tools/commons/dist/index.d.ts
export * from "./middleware/index.js";
export * from "./utils/index.js";
export CHANGELOG.md LICENSE README.md dist node_modules package-lock.json package.json schemas src tsconfig.json typings from ../typings
The last line should not be there. The line was likely added by the build target in package.json
which seem to include some early work on typescript migration:
"build": "tsc && cp src/index.mjs dist/index.mjs && echo export * from '../typings' >> dist/index.d.ts",
Steps to reproduce the behavior:
yarn build
Errors:
../../node_modules/@oas-tools/commons/dist/index.d.ts:3:1 - error TS1128: Declaration or statement expected.
3 export CHANGELOG.md LICENSE README.md dist node_modules package-lock.json package.json schemas src tsconfig.json typings from ../typings
...etc
No extract lines in index.d.ts
.
n/a
n/a
n/a
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.