Skip to content

Commit f8cc855

Browse files
Add markdown linter (#3673)
- Add markdownlint. - Fix markdownlint warnings. - Update actionlint to the latest version. - Update zizmor to the latest version.
1 parent 6202ca9 commit f8cc855

6 files changed

Lines changed: 75 additions & 62 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -1,51 +1,58 @@
1-
name: actions-lint
2-
3-
on:
4-
push:
5-
branches: [ master ]
6-
paths-ignore:
7-
- '**/*.gitattributes'
8-
- '**/*.gitignore'
9-
- '**/*.md'
10-
pull_request:
11-
branches: [ master ]
12-
workflow_dispatch:
13-
14-
permissions: {}
15-
16-
env:
17-
FORCE_COLOR: 3
18-
TERM: xterm
19-
ZIZMOR_VERSION: '1.14.1'
20-
21-
jobs:
22-
lint:
23-
runs-on: ubuntu-latest
24-
25-
permissions:
26-
actions: read
27-
contents: read
28-
security-events: write
29-
30-
steps:
31-
32-
- name: Checkout code
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
paths-ignore:
7+
- '**/*.gitattributes'
8+
- '**/*.gitignore'
9+
- '**/*.md'
10+
pull_request:
11+
branches: [ master ]
12+
workflow_dispatch:
13+
14+
permissions: {}
15+
16+
env:
17+
FORCE_COLOR: 3
18+
TERM: xterm
19+
ZIZMOR_VERSION: '1.16.3'
20+
21+
jobs:
22+
lint:
23+
runs-on: ubuntu-latest
24+
25+
permissions:
26+
actions: read
27+
contents: read
28+
security-events: write
29+
30+
steps:
31+
32+
- name: Checkout code
3333
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
34-
with:
35-
filter: 'tree:0'
36-
persist-credentials: false
37-
show-progress: false
38-
39-
- name: Add actionlint problem matcher
40-
run: echo "::add-matcher::.github/actionlint-matcher.json"
41-
42-
- name: Lint workflows
43-
uses: docker://rhysd/actionlint:1.7.7@sha256:887a259a5a534f3c4f36cb02dca341673c6089431057242cdc931e9f133147e9
44-
with:
45-
args: -color
46-
47-
- name: Lint workflows with zizmor
48-
uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0
49-
with:
50-
persona: pedantic
51-
version: ${{ env.ZIZMOR_VERSION }}
34+
with:
35+
filter: 'tree:0'
36+
persist-credentials: false
37+
show-progress: false
38+
39+
- name: Add actionlint problem matcher
40+
run: echo "::add-matcher::.github/actionlint-matcher.json"
41+
42+
- name: Lint workflows
43+
uses: docker://rhysd/actionlint:1.7.9@sha256:a0383f60d92601e2694e24b24d37df7b6a40bed7cedbc447611c50009bf02d94
44+
with:
45+
args: -color
46+
47+
- name: Lint workflows with zizmor
48+
uses: zizmorcore/zizmor-action@e673c3917a1aef3c65c972347ed84ccd013ecda4 # v0.2.0
49+
with:
50+
persona: pedantic
51+
version: ${{ env.ZIZMOR_VERSION }}
52+
53+
- name: Lint markdown
54+
uses: DavidAnson/markdownlint-cli2-action@30a0e04f1870d58f8d717450cc6134995f993c63 # v21.0.0
55+
with:
56+
config: '.markdownlint.json'
57+
globs: |
58+
**/*.md

.github/zizmor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
rules:
22
anonymous-definition:
33
disable: true
4+
concurrency-limits:
5+
disable: true
6+
dependabot-cooldown:
7+
disable: true
48
undocumented-permissions:
59
disable: true

CONTRIBUTING.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
Contributing to Swashbuckle.AspNetCore
2-
=========
1+
# Contributing to Swashbuckle.AspNetCore
32

43
Contributions to Swashbuckle.AspNetCore are welcomed in the form of constructive, reproducible bug reports, feature requests that align to the project's goals, or better still a PR that's accompanied with passing tests.
54

65
If you have general questions or feedback about using Swashbuckle.AspNetCore, PLEASE DON'T CREATE AN ISSUE AND POST TO STACKOVERFLOW INSTEAD.
76

8-
## Bug Reports ##
7+
## Bug Reports
98

109
If you're reporting a bug, please include a clear description of the issue, the version of Swashbuckle.AspNetCore you're using, and a set of clear repro steps.
1110

1211
Please remember that Swashbuckle.AspNetCore is a free and open-source project provided to the community with zero financial gain to the author(s). Any issues deemed to have a negative or arrogant tone will be closed without response.
1312

14-
## Feature Requests ##
13+
## Feature Requests
1514

16-
Fundamentally, Swashbuckle.AspNetCore is a library that attempts to generate an accurate description for APIs built on ASP.NET Core, using [Swagger 2.0](https://swagger.io/docs/specification/2-0/basic-structure/), according to the routes, controllers and models that have been implemented. So, the resulting API documentation is driven by "actual" behavior as opposed to "intended" behavior. This is an important distinction to consider when submitting feature requests. For example, a feature that leverages built-in attributes that affect runtime behavior (e.g. AuthorizeAttribute, RequiredAttribute etc.) would be more aligned to the project goals than one that introduces custom attributes that drive documentation and nothing else.
15+
Fundamentally, Swashbuckle.AspNetCore is a library that attempts to generate an accurate description for APIs built on ASP.NET Core, using [OpenAPI 3.0](https://swagger.io/docs/specification/v3_0/basic-structure/) (or [Swagger 2.0](https://swagger.io/docs/specification/2-0/basic-structure/)), according to the routes, controllers and models that have been implemented. So, the resulting API documentation is driven by "actual" behavior as opposed to "intended" behavior. This is an important distinction to consider when submitting feature requests. For example, a feature that leverages built-in attributes that affect runtime behavior (e.g. AuthorizeAttribute, RequiredAttribute etc.) would be more aligned to the project goals than one that introduces custom attributes that drive documentation and nothing else.
1716

1817
It's also worth noting that Swashbuckle.AspNetCore leverages the [swagger-ui project](https://github.com/swagger-api/swagger-ui) but doesn't actually implement any UI code. If you have a bug report or feature request that's UI-specific, PLEASE DON'T CREATE AN ISSUE HERE AND POST TO THE SWAGGER-UI REPO INSTEAD.
1918

20-
## Pull Requests ##
19+
## Pull Requests
2120

2221
If you've identified a feature/bug fix that aligns to the project goals, or even just an addition to the docs, please submit a Pull Request (PR). If applicable, include tests and ensure all tests are passing locally before you commit.

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ for more details.
8282
[redoc-version-v7-badge]: https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Fdomaindrivendev%2FSwashbuckle.AspNetCore%2Frefs%2Ftags%2Fv7.3.2%2Fsrc%2FSwashbuckle.AspNetCore.ReDoc%2Fpackage.json&query=%24.dependencies.redoc&style=flat&label=Redoc
8383
[redoc-version-v7-release]: https://github.com/Redocly/redoc/releases/tag/v2.4.0
8484

85+
## Getting Started
86+
8587
First install the kitchen-sink NuGet package into your ASP.NET Core application:
8688

8789
```terminal
@@ -295,15 +297,15 @@ Additionally, there are add-on packages (CLI tools, [an alternate UI using Redoc
295297
### "Core" Packages
296298

297299
| **Package** | **NuGet** | **Description** |
298-
|-------------|--------------------|-----------------|
300+
| ----------- | --------- | --------------- |
299301
| [Swashbuckle.AspNetCore.Swagger][swashbuckle-aspnetcore-swagger] | [![NuGet](https://img.shields.io/nuget/v/Swashbuckle.AspNetCore.Swagger?logo=nuget&label=Latest&color=blue)][swashbuckle-aspnetcore-swagger] | Exposes OpenAPI JSON endpoints. It expects an implementation of `ISwaggerProvider` to be registered in the DI container, which it queries to retrieve `OpenApiDocument` instance(s) that are then exposed as serialized JSON. |
300302
| [Swashbuckle.AspNetCore.SwaggerGen][swashbuckle-aspnetcore-swaggergen] | [![NuGet](https://img.shields.io/nuget/v/Swashbuckle.AspNetCore.SwaggerGen?logo=nuget&label=Latest&color=blue)][swashbuckle-aspnetcore-swaggergen] | Injects an implementation of `ISwaggerProvider` that can be used by the above component. This particular implementation generates `OpenApiDocument` instance(s) from your application endpoints (controllers, minimal endpoints etc.). |
301303
| [Swashbuckle.AspNetCore.SwaggerUI][swashbuckle-aspnetcore-swaggerui] | [![NuGet](https://img.shields.io/nuget/v/Swashbuckle.AspNetCore.SwaggerUI?logo=nuget&label=Latest&color=blue)][swashbuckle-aspnetcore-swaggerui] | Exposes an embedded version of [swagger-ui][swagger-ui]. You specify the API endpoints where it can obtain OpenAPI documents from, and it uses them to power interactive documentation for your API. |
302304

303305
### Additional Packages
304306

305307
| **Package** | **NuGet** | **Description** |
306-
|-------------|--------------------|-----------------|
308+
| ----------- | --------- | --------------- |
307309
| [Swashbuckle.AspNetCore.Annotations][swashbuckle-aspnetcore-annotations] | [![NuGet](https://img.shields.io/nuget/v/Swashbuckle.AspNetCore.Annotations?logo=nuget&label=Latest&color=blue)][swashbuckle-aspnetcore-annotations] | Includes a set of custom attributes that can be applied to controllers/endpoints, actions and models to enrich the generated documentation. |
308310
| [Swashbuckle.AspNetCore.Cli][swashbuckle-aspnetcore-cli] | [![NuGet](https://img.shields.io/nuget/v/Swashbuckle.AspNetCore.Cli?logo=nuget&label=Latest&color=blue)][swashbuckle-aspnetcore-cli] | Provides a command line interface (CLI) for retrieving OpenAPI documents directly from an application start-up assembly and then writing to a file. |
309311
| [Swashbuckle.AspNetCore.ReDoc][swashbuckle-aspnetcore-redoc] | [![NuGet](https://img.shields.io/nuget/v/Swashbuckle.AspNetCore.ReDoc?logo=nuget&label=Latest&color=blue)][swashbuckle-aspnetcore-redoc] | Exposes an embedded version of the [Redoc UI][redoc] (an alternative to [swagger-ui][swagger-ui]). |
@@ -313,7 +315,7 @@ Additionally, there are add-on packages (CLI tools, [an alternate UI using Redoc
313315
These packages are provided by the .NET open-source community.
314316

315317
| **Package** | **NuGet** | **Description** |
316-
|-------------|--------------------|-----------------|
318+
| ----------- | --------- | --------------- |
317319
| [Swashbuckle.AspNetCore.Filters][swashbuckle-aspnetcore-filters] | [![NuGet](https://img.shields.io/nuget/v/Swashbuckle.AspNetCore.Filters?logo=nuget&label=Latest&color=blue)][swashbuckle-aspnetcore-filters] | Some useful Swashbuckle.AspNetCore filters which add additional documentation, e.g. request and response examples, authorization information, etc. See its README for more details. |
318320
| [Unchase.Swashbuckle.AspNetCore.Extensions][unchase-swashbuckle-aspnetcore-extensions] | [![NuGet](https://img.shields.io/nuget/v/Unchase.Swashbuckle.AspNetCore.Extensions?logo=nuget&label=Latest&color=blue)][unchase-swashbuckle-aspnetcore-extensions] | Some useful extensions (filters), which add additional documentation, e.g. hide `PathItems` for unaccepted roles, fix enumerations for client code generation, etc. See its README for more details. |
319321
| [MicroElements.Swashbuckle.FluentValidation][microelements-swashbuckle-fluentvalidation] | [![NuGet](https://img.shields.io/nuget/v/MicroElements.Swashbuckle.FluentValidation?logo=nuget&label=Latest&color=blue)][microelements-swashbuckle-fluentvalidation] | Use [FluentValidation][fluentvalidation] rules instead of ComponentModel attributes to augment generated OpenAPI schemas. |
@@ -325,8 +327,8 @@ The steps described above will get you up and running with minimal set up. Howev
325327

326328
Check out the table below for the full list of possible configuration options.
327329

328-
| **Component** | **Configuration and Customization** |
329-
| ------------- | ----------------------------------- |
330+
| **Component** | **Configuration and Customization** |
331+
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
330332
| **Swashbuckle.AspNetCore.Swagger** | [Change the Path for OpenAPI JSON Endpoints](docs/configure-and-customize-swagger.md#change-the-path-for-openapi-json-endpoints) |
331333
| | [Modify OpenAPI with Request Context](docs/configure-and-customize-swagger.md#modify-openapi-with-request-context) |
332334
| | [Serialize OpenAPI JSON in the 3.1 format](docs/configure-and-customize-swagger.md#serialize-openapi-in-the-31-format) |

Swashbuckle.AspNetCore.slnx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
<File Path=".github/update-baselines.ps1" />
2828
</Folder>
2929
<Folder Name="/Solution Items/.github/workflows/">
30-
<File Path=".github/workflows/actions-lint.yml" />
3130
<File Path=".github/workflows/build.yml" />
3231
<File Path=".github/workflows/bump-version.yml" />
3332
<File Path=".github/workflows/codeql-analysis.yml" />
33+
<File Path=".github/workflows/lint.yml" />
3434
<File Path=".github/workflows/ossf-scorecard.yml" />
3535
<File Path=".github/workflows/release.yml" />
3636
<File Path=".github/workflows/stale.yml" />

docs/migrating-to-v10.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Migrating to Swashbuckle.AspNetCore v10+ will likely involve changes in the foll
8585
}
8686
}
8787
```
88+
8889
- Update any use of `.Reference` properties (e.g. `OpenApiSchema.ReferenceV3`) to use the new `*Reference` class instead (e.g. `OpenApiSchemaReference`).
8990
- Replace usage of the `OpenApiSchema.Type` property using a string (e.g. `"string"` or `"boolean"`) with the `JsonSchemaType` flags enumeration.
9091
- Replace usage of the `OpenApiSchema.Nullable` property by OR-ing the `JsonSchemaType.Null` value to `OpenApiSchema.Type` (e.g. `schema.Type |= JsonSchemaType.Null;`).

0 commit comments

Comments
 (0)