npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rtyughnnpm/minima-et-soluta

v1.0.0

Published

Tools for using the Open API Specification (OAS)

Downloads

7

Maintainers

vibao1638vibao1638

Keywords

yupqueueMicrotaskloggingsomedataviewfile systemspecmatches-shim APIopenargparsecolorirqfastgenericsReactiveXfantasy-landformtyped arrayspeedvisualrm -fr@@toStringTagefficientphonees2018electrontoArraycurriedajvmkdirskarmaprogressjwtesparsejson-schema-validationcode pointskeyswordwrapfunctionsflatsanitizationbootstrap cssframeworkhookformfastcloneramdaapimimetypesbabel-coresortpropertybundlingnegative zeroidleSettypesafejsxairbnbsigtermpackageObject.isjson-schema-validatorReactiveExtensionseventEmitterserializecharactersfullwidtheventsmatchAllObject.getPrototypeOfObject.assignInt16Arraya11ypnpm9StreamssideECMAScript 2017Reflect.getPrototypeOfES5startincludespyyamltrimEndargumentuninstallflatMapwrapisforEachjasminegetmomentes7dayjssettextStreammkdirputil.inspectES3Object.valuespostcssponyfillfast-deep-copybreakdeepclonenodejsconsumeimportsymlinksetPrototypeOflockfilejsobjjestreducerdateString.prototype.trimlessratekoreanfull-widthtoSortedchromiumsliceUint16Arrayapolloeslint-plugin256bluebirdinferencecompile lessguidoptimistserializerformscollection.es6querystringreduxpicomatchfast-copytoStringTagloggerArraygraphqldeepcopywarningsearchargvcallboundcolorsmapes2015packagesloadingdom-testing-libraryobjectwaitObjectoncedotenvjsonschemaerror-handlingless.jsPushrapidObject.definePropertyenderlibphonenumbertypesinspectArray.prototype.flatMaptapisConcatSpreadableflagsreusenameprocesslazyinstallECMAScript 2020react-testing-libraryrequireletvariableslook-upratelimitsignalsparentES2022mime-dbspawnES7dataViewcolumnsbatchfastcopycallbyteLengthfindiedependenciesformattinghashbrowser_.extendnativeprivate datalruCSSStyleDeclarationautoprefixertoolkitcolumnaccessorstreamsless cssString.prototype.matchAllstyleguidereadtaskscheme-validationterminalTypeBoxmoveutilityfolderauthwindowsECMAScript 2022extendstylesheethasOwnenvomithelpersArray.prototype.filterexpressECMAScript 2018nopedescriptorsclidrag$.extendschematimermdirhigher-orderflagawaitio-tsnpmframerserializationchinesexdgECMAScript 2015sharedarraybufferworkspace:*reactbundlercontainstypanionemitequalityESreact posedeep-cloneassertionstringifymruspringgetoptpoint-freeexecutablestreamformatemoji-0polyfillreact-hook-formartcreatesharedsymbolsuperagentreact animationECMAScript 6utilitiesFunction.prototype.namearraybufferprotoprotobufvalidatoranimationviewdeepshrinkwrapInt32ArrayclonecryptodescriptortypedarraysprunepromisebuffersES2023clientcssqueue6to5reducei18ntoolsfunctionsyntaxECMAScript 7touchtostringtagweaksetoffsetHyBitrimslotexpressionequalasciizeroquerywaapiopenerWebSocketECMAScript 2016takeFloat64Arrayprotocol-buffersless mixinssuperstructpersistentasynceveryregexpRegExp#flagsoptionsymbolszodcommand-linesameValueZerojson-schemabuffercallbackdirectoryarraysbabelcodeswebwhichjavascriptkeydropbootstrap lessES2021ECMAScript 3matchesextensionthreedependency managerremoveredactuuidcopyES2018httpses2017immerredux-toolkitfastifycss nestingES2015proppackage managernumberwhatwginternaleditorassigncryptfullObject.fromEntrieslooktypeerrorcjkinputfunctionalfseventsjapaneseshimlinewrap[[Prototype]]typediteratetranspilesettingsyamlunicodeansiwidthObject.entriesvalidtacitcolourmixinsgetintrinsiccomparedebuggeriddataxssArray.prototype.findLasthooksexebddeventDispatcherregularweakmappromisesposeArray.prototype.flathttpappcss-in-jsECMAScript 2019es-shimsquotegettervalidationglobvalueschildeslintpluginmimepackage.jsontranspilerwatchnested csscall-bindYAMLhandlers.envshamstyled-componentsminimaljQueryObservableinterruptsdircommandcollectionfetchintrinsictelephonevestfast-deep-cloneeslinttestRxJSarktypeSymboltrimRightnegativefind-upsymlinkstslibfixed-widthvalidateES2020mkdirprefixwatcherindicatorwalktoobjectbcrypt3dvarsanitizeES8trimLeftpreserve-symlinksBigInt64ArrayhaswritetypeofeslintconfigsetImmediate__proto__invariantconfiggetOwnPropertyDescriptorcmdtestingmacosFloat32ArraypasswordJSON-SchemaestreelimitedutilwordbreakStyleSheettermAsyncIteratorresolveastconcatMaptypescriptECMAScript 2023typereact-hookssigintlogencryptiones2016ES2016preprocessorRFC-6455readableharmonyArray.prototype.findLastIndexArray.prototype.includesESnextlesscsspluginregular expressionURLgroupByES2019jsonpostcss-plugincharacterchannelassertgdpres-abstractlanguageutilsboundmodulecoercibleshellstatussetterBigUint64ArrayWebSocketstc39positive0fast-clonedefineURLSearchParamspopmotionprivatecircularbyteOffsetextramake dirflattendefaultargumentsdefinePropertyes8classnamesfpECMAScript 2021websiteform-validationinstallernameseast-asian-widthassertsregular expressionsregextapeperformantTypedArraydatastructuresequenceconcatObservablesparserargspropertiespurextermPromisejoil10nSymbol.toStringTaglintpushcorsdiffgroupmodulespipeiterationES2017classnameurlchromebrowserslisttypedarraytslastgradients csslaunchArrayBuffer#slicetesterttyaccessibilityrobustIteratorreal-timeMicrosoftoperating-systemfiltercurlcorelistenerspatchfiledeterministicInt8ArraywatchFilerequestescapetrimStartarraylengthstructuredClonerm -rfexit-codeES6nodemakeerrorwgetRegExp.prototype.flagsmonorepointernal slotcallbindajaxfromspinnerJSONstylingavaclass-validatoruser-streamsgesturesrfc4122walkingcomputed-typeslimitentriesspinnersopenscommandersyntaxerrormulti-packagegetPrototypeOfrmUint8ArrayMapArrayBuffermobilestringfindupstableTypeScriptawesomesaucestylesrecursivecensorWeakSetoutput

Readme

OpenAPI-Enforcer

Tools for using the Open API Specification (OAS)

Supports OAS 2.0 (formerly Swagger) and OAS 3.x.x

Features

  • Create an API.
  • Validate your OAS documents.
  • Serialize, deserialize, and validate values against OAS schemas.
  • Identify the operation associated with a request.
  • Parse, deserialize, and validate request parameters.
  • Facilitated response building.
  • Generate random valid values for a schema.
  • Plugin environment for custom document validation and extended functionality including custom data type formats.

Website - @rtyughnnpm/minima-et-soluta.com

Installation

npm install @rtyughnnpm/minima-et-soluta

Examples

Loading and Validating a Document

Use the Enforcer to load and resolve all $ref values and then to validate the complete document.

const Enforcer = require('@rtyughnnpm/minima-et-soluta')

async function run () {
  const [openapi, error, warning] = await Enforcer('./path/to/openapi.yml', {
    fullResult: true
  })
  if (error !== undefined) console.error(error)
  if (warning !== undefined) console.warn(warning)
  if (openapi !== undefined) console.log('Document is valid')
}

run.catch(console.error)

Processing an Incoming Request

const Enforcer = require('@rtyughnnpm/minima-et-soluta')

async function run () {
  // Because we don't specify `fullResult: true`, any errors will throw an exception and
  // warnings will be logged to the console.
  const openapi = await Enforcer('./path/to/openapi.yml')

  // If the request is valid then the req object will contain the parsed and validated request.
  // If it is invalid then the error will contain details about what was wrong with the
  // request and these details are safe to return to the client that made the request.
  const [ req, error ] = openapi.request({
    method: 'POST',
    path: '/tasks',
    // the body should be parsed by a JSON.parse() prior to passing in (if applicable).
    body: { task: 'Buy Milk', quantity: 2 }
  })

  // You can use the req.operation property to look at the properties from your OpenAPI document.
  // A good use of this is to look at the operationId you defined there to determine which path
  // is being used to handle the request.
  if (req.operaton.operationId === 'my-operation-id') {
    // ... additional request processing
  }
}

run.catch(console.error)

Producing a Valid Result

const Enforcer = require('@rtyughnnpm/minima-et-soluta')

async function run () {
  const openapi = await Enforcer('./path/to/openapi.yml')

  const [ req ] = openapi.request({
    method: 'POST',
    path: '/tasks',
    // the body should be parsed by a JSON.parse() prior to passing in (if applicable).
    body: { task: 'Buy Milk', quantity: 2 }
  })

  const body = { id: 1, task: 'Buy Milk', quantity: 2, dateCompleted: null }
  const headers = {}

  // This will validate the response code, body, and headers. It will also correctly serialize
  // the body and headers for sending to the client that made the request. Using this method
  // you'll never send back a response that does not match what your OpenAPI document defines.
  const [ res, error ] = req.response(200, body, headers)
  console.log(res.body, res.headers)
}

run.catch(console.error)