![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@ts-stack/openapi-spec
Advanced tools
This is OpenAPI Specification v3.1.0 writen in TypeScript.
@ts-stack/openapi-spec
has TypeScript models according to OpenAPI Specification v3.1.0.
To use it, required TypeScript v4.1+.
Major and minor versions of @ts-stack/openapi-spec
are the same as OpenAPI Specification,
but the patch version is not the same:
OpenAPI Specification | @ts-stack/openapi-spec |
---|---|
v3.1.0 |
|
The OpenAPI Specification (OAS) defines a standard, language-agnostic interface to RESTful APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined, a consumer can understand and interact with the remote service with a minimal amount of implementation logic.
An OpenAPI definition can then be used by documentation generation tools to display the API, code generation tools to generate servers and clients in various programming languages, testing tools, and many other use cases.
npm i -D @ts-stack/openapi-spec
You can use the openapi
constant that contains the version of the OpenAPI Specification:
import { openapi } from '@ts-stack/openapi-spec';
console.log(openapi) // 3.1.0
If you want to use already extended interfaces, you need to import interfaces with the X
prefix:
import { XOasObject } from '@ts-stack/openapi-spec';
const extendedOasObject: XOasObject<'x-one' | 'x-two'> = {
info: { title: '', version: '' },
openapi: '',
'x-one': '',
'x-two': '',
};
Or, you can extends any of model in this way:
import { OasObject, SpecificationExtension } from '@ts-stack/openapi-spec';
type ExtendedOasObject = OasObject & SpecificationExtension<'x-one' | 'x-two'>;
const extendedOasObject: ExtendedOasObject = {
info: { title: '', version: '' },
openapi: '',
'x-one': '',
'x-two': '',
};
Same but with an interface to extends properties:
import { OasObject, SpecificationExtension } from '@ts-stack/openapi-spec';
interface ExtendedProperties {
'x-one': any,
'x-two': any
}
type ExtendedOasObject = OasObject & SpecificationExtension<keyof ExtendedProperties>;
const extendedOasObject: ExtendedOasObject = {
info: {title: '', version: ''},
openapi: '',
'x-one': '',
'x-two': '',
};
import { PathsObject } from '@ts-stack/openapi-spec';
type Paths = '/one' | '/two';
type StrictDifinedPaths = PathsObject<Paths>;
const paths: StrictDifinedPaths = {
'/one': {},
'/two': {},
};
FAQs
This is OpenAPI Specification v3.1.0 writen in TypeScript.
We found that @ts-stack/openapi-spec demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.