Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/advanced-rest-client/api-endpoint-documentation

⛔️ DEPRECATED This component is being deprecated. Use `api-documentation` instead.
https://github.com/advanced-rest-client/api-endpoint-documentation

deprecated obsolete

Last synced: about 1 month ago
JSON representation

⛔️ DEPRECATED This component is being deprecated. Use `api-documentation` instead.

Awesome Lists containing this project

README

        

# DEPRECATED

This component is being deprecated. The code base has been moved to [amf-components](https://github.com/advanced-rest-client/amf-components) module. This module will be archived when [PR 1](https://github.com/advanced-rest-client/amf-components/pull/1) is merged.

-----

A component to generate documentation for an API resource from AMF model.

[![Tests and publishing](https://github.com/advanced-rest-client/api-endpoint-documentation/actions/workflows/deployment.yml/badge.svg)](https://github.com/advanced-rest-client/api-endpoint-documentation/actions/workflows/deployment.yml)

[![Published on NPM](https://img.shields.io/npm/v/@api-components/api-endpoint-documentation.svg)](https://www.npmjs.com/package/@api-components/api-endpoint-documentation)

## Version compatibility

This version only works with AMF model version 2 (AMF parser >= 4.0.0).
For compatibility with previous model version use `3.x.x` version of the component.

## Styling

`` provides the following custom properties and mixins for styling:

Custom property | Description | Default
----------------|-------------|----------
`--arc-font-headline-color` | Color of the method title | ``
`--arc-font-headline-font-size` | Font size of the method title | ``
`--arc-font-headline-letter-spacing` | Letter spacing of the method title | ``
`--arc-font-headline-line-height` | Line height of the method title | ``
`--arc-font-headline-narrow-font-size` | Font size of the method title in mobile-friendly view | ``
`--arc-font-title-color` | Color of the overview section title | ``
`--arc-font-title-font-size` | Font size of the overview section title | ``
`--arc-font-title-line-height` | Line height of the overview section title | ``
`--arc-font-title-narrow-font-size` | Font size of the overview section title in mobile-friendly view | ``
`--arc-font-subhead-color` | Color of the collapsible section title | ``
`--arc-font-subhead-font-size` | Font size of the collapsible section title | ``
`--arc-font-subhead-line-height` | Line height of the collapsible section title | ``
`--arc-font-subhead-narrow-font-size` | Font size of the collapsible section title in mobile-friendly view | ``
`--api-endpoint-documentation-description-color` | | `rgba(0, 0, 0, 0.74)`
`--api-endpoint-documentation-bottom-navigation-color` | | `#000`
`--api-endpoint-documentation-method-doc-border-top-color` | | `#E5E5E5`
`--api-endpoint-documentation-method-doc-border-top-style` | | `dashed`
`--api-endpoint-documentation-tryit-width` | | `40%`
`--api-endpoint-documentation-tryit-max-width` | | ``
`--api-endpoint-documentation-tryit-background-color` | | `#ECEFF1`
`--api-endpoint-documentation-tryit-panels-background-color` | | `#fff`
`--api-endpoint-documentation-tryit-panels-border-radius` | | `3px`
`--api-endpoint-documentation-tryit-panels-border-color` | | `#EEEEEE`
`--api-endpoint-documentation-tryit-panels-border-style` | | `solid`
`--api-endpoint-documentation-tryit-title-border-bottom-color` | | `#bac6cb`
`--api-endpoint-documentation-tryit-title-border-bottom-style` | | `solid`
`--no-info-message-font-style` | | `italic`
`--no-info-message-font-size` | | `16px`
`--no-info-message-color` | | `rgba(0, 0, 0, 0.74)`

## Usage

### Installation

```sh
npm install --save @api-components/api-endpoint-documentation
```

### In an html file

```html



import '@api-components/api-endpoint-documentation/api-endpoint-documentation.js';




```

### In a LitElement

```js
import { LitElement, html } from 'lit-element';
import '@api-components/api-endpoint-documentation/api-endpoint-documentation.js';

class SampleElement extends PolymerElement {
render() {
return html`

`;
}

_tryitHandler(e) {
console.log('opening api-request-panel...');
}
}
customElements.define('sample-element', SampleElement);
```

## Development

```sh
git clone https://github.com/advanced-rest-client/api-endpoint-documentation
cd api-endpoint-documentation
npm install
```

### Running the demo locally

```sh
npm start
```

### Running the tests

```sh
npm test
```

## Breaking Changes in v3

When using `inlineMethods` property you should note this breaking changes.

### OAuth popup location

The `bower-location` attribute becomes `auth-popup-location`.
It is a path to `node_modules` directory. It can be both relative or absolute location. For example `/static/console/node_modules` will produce OAuth Redirect URI `/static/console/node_modules/@advanced-rest-client/oauth-authorization/oauth-popup.html`.

However, you are encourage to use your own redirect popup. It can be anything but it must post message to the opened window with URL parameters. See `@advanced-rest-client/oauth-authorization/oauth-popup.html` for more details.

### Code Mirror dependencies

Code mirror is not ES6 ready. Their build contains AMD exports which is incompatible with native modules. Therefore the dependencies cannot be imported with the element but outside of it.
The component requires the following scripts to be ready before it's initialized (especially body and headers editors):

```html

```

CodeMirror's modes location. May be skipped if all possible modes are already included into the app.

```html

/* global CodeMirror */
CodeMirror.modeURL = 'node_modules/codemirror/mode/%N/%N.js';

```

### Dependencies for OAuth1 and Digest authorization methods

For the same reasons as for CodeMirror this dependencies are required for OAuth1 and Digest authorization panels to work.

```html

```