# loas3

> OpenAPI 3.0.0 for lazy people

Latest version **0.1.4** (published 2019-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install loas3
pnpm add loas3
yarn add loas3
bun add loas3
```

Provides the command `loas3`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2019-09-12 |
| First published | 2019-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 737.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mike Solomon |
| Maintainers | meeshkan |

## Links

- npm: https://www.npmjs.com/package/loas3
- Repository: https://github.com/unmock/loas3
- Homepage: https://github.com/unmock/loas3#readme
- Issues: https://github.com/unmock/loas3/issues
- npm.io page: https://npm.io/package/loas3

## Dependencies (6)

- [ajv](https://npm.io/package/ajv.md) ^6.10.0
- [fp-ts](https://npm.io/package/fp-ts.md) ^2.0.0
- [io-ts](https://npm.io/package/io-ts.md) ^1.10.2
- [prettier](https://npm.io/package/prettier.md) ^1.18.2
- [ajv-errors](https://npm.io/package/ajv-errors.md) ^1.0.1
- [ajv-keywords](https://npm.io/package/ajv-keywords.md) ^3.4.0

## Recent versions

- 0.1.4 (latest) — 2019-09-12
- 0.1.2 — 2019-09-12
- 0.1.1 — 2019-08-09
- 0.1.0 — 2019-08-05
- 0.0.5 — 2019-07-15
- 0.0.4 — 2019-07-04
- 0.0.3 — 2019-06-26
- 0.0.2 — 2019-06-26
- 0.0.1 — 2019-06-26
- 0.0.0 — 2019-06-25

## README

[![CircleCI](https://circleci.com/gh/unmock/loas3.svg?style=svg)](https://circleci.com/gh/unmock/loas3)

# loas3

OpenAPI 3 for lazy people.

## tl;dr

This:

```yaml
paths:
  /foo: 1
```

becomes:

```yaml
openapi: 3.0.0
info:
  name: lazy
  version: 0.0.0
paths:
  /foo:
    get:
      responses:
        default:
          description: too lazy
          content:
            application-json:
              schema:
                type: integer
                format: int64
                default: 1
```

## Why

Because sometimes you need to write an OpenAPI spec.

## TODO

- Better (lazy) types.
- More examples.

## How does it work?

Lazy JSON schema is defined in [src/schema/lazy.ts](src/schema/lazy.ts). These, along with the "un"-lazy types from the JSON schema for the [official OpenAPI 3.0 Specification](src/schema/full.ts) are translated into TypeScript types and validators. The lazy OAS3 is expanded into full OAS 3 based on various sensible conventions.

## Examples

See the [tests](test/).

## Command-line usage

### [yarn](https://yarnpkg.com/en/)

```bash
// Install loas3
yarn add loas3

// Convert a lazy specification into OpenAPI
yarn loas3 /path/to/lazy-spec.yaml
```

### [npx](https://www.npmjs.com/package/npx)

```bash
// Install loas3
npm i loas3

// Convert a lazy specification into OpenAPI
npx loas3 /path/to/lazy-spec.yaml
```

## Development

Install dependencies and run tests:

```bash
yarn
```

Run the CLI

```bash
yarn cli /path/to/lazy-spec.yml
```

## ACHTUNG!

There is one important difference between our flavor of OpenAPI and the real OpenAPI spec. Here, `items` can be **either** a Schema **or** an array of schemas.

---
_Source: https://npm.io/package/loas3 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
