0.1.6 • Published 3 months ago

@backstage/plugin-api-docs-module-protoc-gen-doc v0.1.6

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 months ago

@backstage/plugin-api-docs-module-protoc-gen-doc

This package contains ApiDefinitionWidgets for the following projects:

Setup

yarn add @backstage/plugin-api-docs-module-protoc-gen-doc

Add the GrpcDocsApiWidget to your apis

Add the widget to your apiDocsConfigRef.

import { grpcDocsApiWidget } from '@backstage/plugin-api-docs-module-protoc-gen-doc';
// packages/app/apis.ts
export const apis: AnyApiFactory[] = [
  createApiFactory({
    api: apiDocsConfigRef,
    deps: {},
    factory: () => {
      // load the default widgets
      const definitionWidgets = defaultDefinitionWidgets();
      // add the grpc-docs api widget to the definition widgets
      definitionWidgets.push(grpcDocsApiWidget);
      return {
        getApiDefinitionWidget: (apiEntity: ApiEntity) => {
          // find the widget for the type of api entity
          return definitionWidgets.find(d => d.type === apiEntity.spec.type);
        },
      };
    },
  }),
];

Set the type in your api entities

This widget will render the generated protoc-gen-doc descriptors with the grpc-docs package. For this make sure you use the grpc-docs as the type in the API catalog file.

apiVersion: backstage.io/v1alpha1
kind: API
metadata:
  name: hello-world
  description: Hello World example for gRPC
spec:
  type: grpc-docs
  lifecycle: deprecated
  owner: foo
  definition:
    $text: https://fetch-my-json.com/awesome-resource.json
0.1.6

3 months ago

0.1.6-next.0

3 months ago

0.1.3-next.1

8 months ago

0.1.3-next.0

9 months ago

0.1.5-next.0

7 months ago

0.1.4

7 months ago

0.1.3

8 months ago

0.1.5

6 months ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.2-next.0

1 year ago

0.1.0

2 years ago

0.1.0-next.0

2 years ago