Skip to content

Commit dec4411

Browse files
Merge pull request #2252 from musale/chore/fix-readme
chore: update the readme for hidi examples and commands
2 parents 2cfa031 + 5a3826c commit dec4411

File tree

1 file changed

+67
-45
lines changed

1 file changed

+67
-45
lines changed

src/Microsoft.OpenApi.Hidi/readme.md

Lines changed: 67 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,22 @@ Install [Microsoft.OpenApi.Hidi](https://www.nuget.org/packages/Microsoft.OpenAp
1717

1818
### .NET CLI(Global)
1919

20-
1. dotnet tool install --global Microsoft.OpenApi.Hidi --prerelease
21-
20+
```bash
21+
dotnet tool install --global Microsoft.OpenApi.Hidi --prerelease
22+
```
2223

2324
### .NET CLI(local)
24-
25-
1. dotnet new tool-manifest #if you are setting up the OpenAPI.NET repo
26-
2. dotnet tool install --local Microsoft.OpenApi.Hidi --prerelease
2725

26+
```bash
27+
dotnet new tool-manifest #if you are setting up the OpenAPI.NET repo
28+
dotnet tool install --local Microsoft.OpenApi.Hidi --prerelease
29+
```
2830

2931

3032

3133
## How to use Hidi
3234

33-
Once you've installed the package locally, you can invoke the Hidi by running: hidi [command].
34-
You can access the list of command options we have by running hidi -h
35+
Once you've installed the package locally, you can invoke the Hidi by running: `hidi [command]`. You can access the list of command options we have by running `hidi -h`
3536
The tool avails the following commands:
3637

3738
• Validate
@@ -57,63 +58,84 @@ It accepts the following command:
5758
• --loglevel(-ll) - The log level to use when logging messages to the main output
5859
5960

60-
**Example:** `hidi.exe validate --openapi C:\OpenApidocs\Mail.yml --loglevel trace`
61+
#### Example:
6162

62-
Run validate -h to see the options available.
63+
```bash
64+
hidi validate --openapi C:\OpenApidocs\Mail.yml --loglevel trace`
65+
```
66+
67+
> Run `hidi validate -h` to see the options available.
6368

6469
### Transform
6570

6671
Used to convert file formats from JSON to YAML and vice versa and performs slicing of OpenAPI documents.
6772

6873
This command accepts the following parameters:
6974

70-
• --openapi(-d) - OpenAPI description file path in the local filesystem or a valid URL hosted on a HTTPS server
71-
• --csdl(--cs) - CSDL file path in the local filesystem or a valid URL hosted on a HTTPS server
72-
• --csdlfilter(--csf) - a filter parameter that a user can use to select a subset of a large CSDL file. They do so by providing a comma delimited list of EntitySet and Singleton names that appear in the EntityContainer.
73-
• --output(-o) - Output directory path for the transformed document.
74-
• --output-folder(--of) - The output directory path for the generated files.
75-
• --clean-ouput(--co) - an optional param that allows a user to overwrite an existing file.
76-
• --version(-v) - OpenAPI specification version.
77-
• --metadata-version(--mv) - the metadata version to use.
78-
• --format(-f) - File format
79-
• --terse-output(--to) - Produce terse json output
80-
• --settings-path(--sp) - The configuration file with CSDL conversion settings.
81-
• --loglevel(--ll) - The log level to use when logging messages to the main output
82-
• --inline-local - Inline local $ref instances
83-
• --inline-external(--ex) - Inline external $refs
84-
• --filterByOperationIds(--op) - Slice document based on OperationId(s) provided. Accepts a comma delimited list of operation ids.
85-
• --filterByTags(-t) - Slice document based on tag(s) provided. Accepts a comma delimited list of tags.
86-
• --filterByCollection(-c) - Slices the OpenAPI document based on the Postman Collection file generated by Resource Explorer
87-
• --manifest (-m) - Slices the OpenAPI document based on the requests defined in the API Manifest file referenced by the provided URI. For API manifests with multiple API Dependenties, use a fragment identifier to select the desired one. e.g ./apimanifest.json#example
75+
76+
• --openapi, (-d) - OpenAPI description file path in the local filesystem or a valid URL hosted on a HTTPS server
77+
• --csdl (--cs) - CSDL file path in the local filesystem or a valid URL hosted on a HTTPS server
78+
• --csdl-filter (--csf) - a filter parameter that a user can use to select a subset of a large CSDL file. They do so by providing a comma delimited list of EntitySet and Singleton names that appear in the EntityContainer.
79+
• --output (-o) - Output directory path for the transformed document.
80+
• --clean-output (--co) - an optional param that allows a user to overwrite an existing file.
81+
• --version (-v) - OpenAPI specification version.
82+
• --metadata-version (--mv) - the metadata version to use.
83+
• --format (-f) - File format
84+
• --terse-output (--to) - Produce terse json output
85+
• --settings-path (--sp) - The configuration file with CSDL conversion settings.
86+
• --log-level (--ll) - The log level to use when logging messages to the main output
87+
• --inline-local (--il) - Inline local $ref instances
88+
• --inline-external (--ie) - Inline external $refs instances
89+
• --filter-by-operationids(--op) - Slice document based on OperationId(s) provided. Accepts a comma delimited list of operation ids.
90+
• --filter-by-tags (--t) - Slice document based on tag(s) provided. Accepts a comma delimited list of tags.
91+
• --filter-by-collection (-c) - Slices the OpenAPI document based on the Postman Collection file generated by Resource Explorer
8892

89-
**Examples:**
93+
#### Examples:
9094

91-
1. Filtering by OperationIds
92-
hidi transform -d files\People.yml -f yaml -o files\People.yml -v OpenApi3_0 --op users_UpdateInsights --co
93-
94-
2. Filtering by Postman collection
95-
hidi transform --openapi files\People.yml --format yaml --output files\People2.yml --version OpenApi3_0 --filterByCollection Graph-Collection-0017059134807617005.postman_collection.json
96-
97-
3. CSDL--->OpenAPI conversion and filtering
98-
hidi transform --csdl Files/Todo.xml --output Files/Todo-subset.yml --format yaml --version OpenApi3_0 --filterByOperationIds Todos.Todo.UpdateTodo
99-
100-
4. CSDL Filtering by EntitySets and Singletons
101-
hidi transform --cs dataverse.csdl --csdlFilter "appointments,opportunities" -o appointmentsAndOpportunities.yaml --ll trace
102-
103-
Run transform -h to see all the available usage options.
95+
1. Filtering by OperationIds
96+
97+
```bash
98+
hidi transform -d files\People.yml -f yaml -o files\People.yml -v OpenApi3_0 --op users_UpdateInsights --co
99+
```
100+
101+
2. Filtering by Postman collection
102+
103+
```bash
104+
hidi transform --openapi files\People.yml --format yaml --output files\People2.yml --version OpenApi3_0 --filter-by-collection Graph-Collection-0017059134807617005.postman_collection.json
105+
```
106+
107+
3. CSDL--->OpenAPI conversion and filtering
108+
109+
```bash
110+
hidi transform --csdl Files/Todo.xml --output Files/Todo-subset.yml --format yaml --version OpenApi3_0 --filter-by-operationids Todos.Todo.UpdateTodo
111+
```
112+
113+
4. CSDL Filtering by EntitySets and Singletons
114+
115+
```bash
116+
hidi transform --cs dataverse.csdl --csdl-filter "appointments,opportunities" -o appointmentsAndOpportunities.yaml --ll trace
117+
```
118+
119+
> Run `hidi transform -h` to see all the available usage options.
104120

105121
### Show
106122

107123
This command accepts an OpenAPI document as an input parameter and generates a Markdown file that contains a diagram of the API using Mermaid syntax.
108124

109-
**Examples:**
125+
#### Examples:
110126

111-
1. hidi show -d files\People.yml -o People.md -ll trace
127+
```bash
128+
hidi show -d files\People.yml -o People.md -ll trace
129+
```
112130

113131
### Plugin
114132

115133
This command generates an OpenAI style Plugin manifest and minimal OpenAPI file based on the provided API Manifest
116134

117-
**Examples:**
135+
#### Examples:
136+
137+
```bash
138+
hidi plugin -m exampleApiManifest.yml -o mypluginfolder
139+
```
118140

119-
1. hidi plugin -m exampleApiManifest.yml -o mypluginfolder
141+
> Run `hidi plugin -h` to see all the available usage options.

0 commit comments

Comments
 (0)