0.0.68 • Published 1 year ago

@storybook-extras/swagger v0.0.68

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Getting started

  1. Install the addon:
yarn add @storybook-extras/swagger -D
  1. Add the addon
// .storybook/main.ts
import { StorybookConfig } from '@storybook/angular';
import { ExtrasConfig } from '@storybook-extras/preset';

const config: StorybookConfig & ExtrasConfig = {
    ...
    "addons": [
        "@storybook-extras/swagger",
        ...
    ],
    ...
}

export default config;

How to use

  • OpenAPI (formly Swagger) is a popular specification for the management of RESTful APIs. Usually OpenAPI produces a openapi.yml or openapi.json file that can be used to integrate/visualize the APIs configured on the backend server.

  • Swagger UI is a popular framework for the visualization of the openapi.yml|json files that allow comprehensive documentation + testing for the backend API services.

  • Thanks to the pre available swagger-ui-react, this feature simply integrates SwaggerUI component into one .mdx file and make it available on demand if the user decides to populate the url option when configuring the addon like so:

EXPERIMENTAL FEATURE For the current time being, the stories property is working with only one item. We are working on this feature to allow multiple endpoints and hopefully more configuration items in the near future releases.

// .storybook/main.ts
import { StorybookConfig } from '@storybook/angular';
import { ExtrasConfig } from '@storybook-extras/preset';

const config: StorybookConfig & ExtrasConfig = {
    addons: [
        {
            name: '@storybook-extras/swagger',
            options: {
                stories: [
                    {
                        title: 'Swagger UI',
                        url: 'https://petstore3.swagger.io/api/v3/openapi.json',
                    },
                ],
            }
        }
    ]
}

export default config;
0.0.68

1 year ago

0.0.40

1 year ago

0.0.46

1 year ago

0.0.37

1 year ago

0.0.38

1 year ago

0.0.39

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.36

1 year ago

0.0.62

1 year ago

0.0.63

1 year ago

0.0.64

1 year ago

0.0.65

1 year ago

0.0.66

1 year ago

0.0.67

1 year ago

0.0.60

1 year ago

0.0.61

1 year ago

0.0.59

1 year ago

0.0.51

1 year ago

0.0.52

1 year ago

0.0.53

1 year ago

0.0.54

1 year ago

0.0.55

1 year ago

0.0.56

1 year ago

0.0.57

1 year ago

0.0.58

1 year ago

0.0.50

1 year ago

0.0.48

1 year ago

0.0.31

1 year ago

0.0.30

1 year ago

0.0.28

1 year ago

0.0.27

1 year ago

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago