Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OpenAPI learn page #9626

Closed

Conversation

lnash94
Copy link
Member

@lnash94 lnash94 commented Nov 29, 2024

Purpose

$Subject

Fixes# ballerina-platform/ballerina-library#7420

Checklist

  • Page addition

    • Add permalink to pages.
  • Page removal

    • Remove entry from corresponding left nav YAML file.
    • Add redirect_from on the alternative page.
    • If no alternative page, add redirection on the redirections.js file.
  • Page rename

    • Add front-matter redirect_from.
    • Add front-matter redirect_to: (if applicable).
  • Page restrcuture

    • Add permalink to pages.
    • Add front-matter redirect_from.
    • Add front-matter redirect_to: (if applicable).

@lnash94 lnash94 force-pushed the u11-openapi-learn-page branch from 659cfbc to 69f0bb0 Compare November 29, 2024 10:14
@lnash94 lnash94 marked this pull request as ready for review December 2, 2024 12:00
@lnash94 lnash94 force-pushed the u11-openapi-learn-page branch 3 times, most recently from df0feb7 to 982df9e Compare December 2, 2024 12:17
@lnash94 lnash94 force-pushed the u11-openapi-learn-page branch from 982df9e to 18231f0 Compare December 2, 2024 12:24
swan-lake/integration-tools/openapi-tool.md Show resolved Hide resolved
swan-lake/integration-tools/openapi-tool.md Outdated Show resolved Hide resolved
swan-lake/integration-tools/openapi-tool.md Outdated Show resolved Hide resolved
swan-lake/integration-tools/openapi-tool.md Outdated Show resolved Hide resolved
swan-lake/integration-tools/openapi-tool.md Outdated Show resolved Hide resolved
swan-lake/integration-tools/openapi-tool.md Outdated Show resolved Hide resolved
swan-lake/integration-tools/openapi-tool.md Outdated Show resolved Hide resolved
swan-lake/integration-tools/openapi-tool.md Outdated Show resolved Hide resolved
swan-lake/integration-tools/openapi-tool.md Outdated Show resolved Hide resolved
swan-lake/integration-tools/openapi-tool.md Show resolved Hide resolved
Copy link
Member

@SachinAkash01 SachinAkash01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -46,17 +46,43 @@ $ bal openapi [-i | --input] <ballerina-service-file-path> [--json]
[-o | --output] <output-location>
```

### Sanitize OpenAPI

The Ballerina to OpenAPI command supports several usages in the Ballerina OpenAPI tool as follows.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence seems to be generic. Can we relate it to the title please?

@@ -46,17 +46,43 @@ $ bal openapi [-i | --input] <ballerina-service-file-path> [--json]
[-o | --output] <output-location>
```

### Sanitize OpenAPI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sanitize OpenAPI what? Can we be more specific?

Copy link
Member Author

@lnash94 lnash94 Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing this title to the "OpenAPI sanitize command usage" or "OpenAPI sanitize CLI usage"
WDYT @TharmiganK , @SachinAkash01

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe we can use Sanitize OpenAPI contract usage since it gives more context on what we are doing? @lnash94 @TharmiganK

Copy link
Member Author

@lnash94 lnash94 Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to that, considering the various CLI commands available in OpenAPI tool, prefer to use command options instead of usage for the title. The term usage typically implies a broader scenario in which this functionality might be employed.

For example, in a Ballerina-to-OpenAPI context, 'usage' could include references to CLI commands, compiler plugins, or built-in plugins.

However, in this specific section, we are focusing on CLI options. we need to address this change in other CLI title as well.

| `--json` | Generate the Ballerina service to OpenAPI output as JSON. The default is YAML. | Optional |
| `-s \| --service` | This service name is used to identify the service that needs to be documented as an OpenAPI contract. | Optional |
| `-o\|--output` | Location of the generated OpenAPI contract. If this path is not specified, the output is written to the same directory from which the command is run. | Optional |

### Sanitize OpenAPI

The command-line arguments below can be used with the command for each particular purpose as described below.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still don't think is necessary. Can just say something along the lines of the following options are available.

swan-lake/integration-tools/openapi-tool.md Outdated Show resolved Hide resolved
@@ -46,17 +46,43 @@ $ bal openapi [-i | --input] <ballerina-service-file-path> [--json]
[-o | --output] <output-location>
```

### Sanitize OpenAPI contract usage

The Sanitize OpenAPI command supports several options in the Ballerina OpenAPI tool as follows.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Sanitize OpenAPI command supports several options in the Ballerina OpenAPI tool as follows.
The `sanitize` subcommand of the Ballerina OpenAPI tool supports the following options.

| `--json` | Generate the Ballerina service to OpenAPI output as JSON. The default is YAML. | Optional |
| `-s \| --service` | This service name is used to identify the service that needs to be documented as an OpenAPI contract. | Optional |
| `-o\|--output` | Location of the generated OpenAPI contract. If this path is not specified, the output is written to the same directory from which the command is run. | Optional |

### Sanitize OpenAPI contract
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be clearer to have the option descriptions where they are mentioned above?

| Command option | Description | Mandatory/Optional |
|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| `-i \| --input` | This specifies the path of the OpenAPI contract file (e.g., `my-api.yaml` or `my-api.json`). | Mandatory |
| `-o \| --output` | The modified OpenAPI file is generated at the same location from which the `bal openapi sanitize` command is executed. You can point to another directory using the `(-o\|--output)` option. | Optional |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would describe the option first and then say if not specified, ...


| Command option | Description | Mandatory/Optional |
|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| `-i \| --input` | This specifies the path of the OpenAPI contract file (e.g., `my-api.yaml` or `my-api.json`). | Mandatory |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrasing is not uniform with the rest. Starts with "This ...", unlike others.

@MaryamZi
Copy link
Member

MaryamZi commented Jan 8, 2025

Closing this PR since the changes will be included in #9663

cc @SachinAkash01 @TharmiganK

@MaryamZi MaryamZi closed this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants