Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Path parameter handling policy #3

Open
kamiazya opened this issue Jun 28, 2021 · 0 comments
Open

Path parameter handling policy #3

kamiazya opened this issue Jun 28, 2021 · 0 comments

Comments

@kamiazya
Copy link
Contributor

Overview

The policy for handling path parameters is undecided.

Currently, if the path parameters are described as follows, the following parameters.mdx will be output.

input: openapi.yaml

...
path:
  '{someId}':
    parameters:
      - name: someId
        in: path
        required: True
        type: integer
...

output: parameters.mdx

---
title: PARAMETERS
sidebar_label: PARAMETERS
---
import {FormadocsTag, FormadocsMethod, FormadocsEndpoint, FormadocsParameters, FormadocsRequestBody, FormadocsResponses} from '/src/formadocs';

<FormadocsTag endpoint={'/{someId}'} method={'parameters'} />

## URL
<FormadocsEndpoint endpoint={'/{someId}'} method={'parameters'} />

<FormadocsMethod endpoint={'/{someId}'} method={'parameters'} />

## Parameters
<FormadocsParameters endpoint={'/{someId}'} method={'parameters'} />

## Request Body
<FormadocsRequestBody endpoint={'/{someId}'} method={'parameters'} />

## Responses
<FormadocsResponses endpoint={'/{someId}'} method={'parameters'} />

Proposal

Allow <FormadocsParameters /> component to display common path parameters without outputting the parameter.mdx.

Alternative Proposal

  • A. Describe common path parameters in overview for each path.
  • B. Output with a template that deletes unnecessary items such as Request Body.

B. example: new paramators.mdx template

---
title: PARAMETERS
sidebar_label: PARAMETERS
---
import { FormadocsEndpoint, FormadocsParameters } from '/src/formadocs';

## URL
<FormadocsEndpoint endpoint={'/{someId}'} method={'parameters'} />

## Parameters
<FormadocsParameters endpoint={'/{someId}'} method={'parameters'} />
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant