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

Check for superfluous trailing whitespace #636

Merged
merged 2 commits into from Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/go.yml
Expand Up @@ -91,6 +91,11 @@ jobs:
name: nilness
run: go run golang.org/x/tools/go/analysis/passes/nilness/cmd/nilness@latest ./...

- if: runner.os == 'Linux'
name: Check for superfluous trailing whitespace
run: |
! grep -IErn '\s$' --exclude-dir={.git,target,pgdata}

- if: runner.os == 'Linux'
name: Missing specification object link to definition
run: |
Expand Down
96 changes: 48 additions & 48 deletions openapi3/testdata/link-example.yaml
@@ -1,23 +1,23 @@
openapi: 3.0.0
info:
info:
title: Link Example
version: 1.0.0
paths:
/2.0/users/{username}:
get:
paths:
/2.0/users/{username}:
get:
operationId: getUserByName
parameters:
parameters:
- name: username
in: path
required: true
schema:
type: string
responses:
responses:
'200':
description: The User
content:
application/json:
schema:
schema:
$ref: '#/components/schemas/user'
links:
userRepositories:
Expand All @@ -34,7 +34,7 @@ paths:
responses:
'200':
description: repositories owned by the supplied user
content:
content:
application/json:
schema:
type: array
Expand All @@ -43,10 +43,10 @@ paths:
links:
userRepository:
$ref: '#/components/links/UserRepository'
/2.0/repositories/{username}/{slug}:
get:
/2.0/repositories/{username}/{slug}:
get:
operationId: getRepository
parameters:
parameters:
- name: username
in: path
required: true
Expand All @@ -57,20 +57,20 @@ paths:
required: true
schema:
type: string
responses:
responses:
'200':
description: The repository
content:
application/json:
schema:
application/json:
schema:
$ref: '#/components/schemas/repository'
links:
repositoryPullRequests:
$ref: '#/components/links/RepositoryPullRequests'
/2.0/repositories/{username}/{slug}/pullrequests:
get:
/2.0/repositories/{username}/{slug}/pullrequests:
get:
operationId: getPullRequestsByRepository
parameters:
parameters:
- name: username
in: path
required: true
Expand All @@ -85,23 +85,23 @@ paths:
in: query
schema:
type: string
enum:
enum:
- open
- merged
- declined
responses:
responses:
'200':
description: an array of pull request objects
content:
application/json:
schema:
application/json:
schema:
type: array
items:
items:
$ref: '#/components/schemas/pullrequest'
/2.0/repositories/{username}/{slug}/pullrequests/{pid}:
get:
/2.0/repositories/{username}/{slug}/pullrequests/{pid}:
get:
operationId: getPullRequestsById
parameters:
parameters:
- name: username
in: path
required: true
Expand All @@ -117,20 +117,20 @@ paths:
required: true
schema:
type: string
responses:
responses:
'200':
description: a pull request object
content:
application/json:
schema:
application/json:
schema:
$ref: '#/components/schemas/pullrequest'
links:
pullRequestMerge:
$ref: '#/components/links/PullRequestMerge'
/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge:
post:
/2.0/repositories/{username}/{slug}/pullrequests/{pid}/merge:
post:
operationId: mergePullRequest
parameters:
parameters:
- name: username
in: path
required: true
Expand All @@ -146,7 +146,7 @@ paths:
required: true
schema:
type: string
responses:
responses:
'204':
description: the PR was successfully merged
components:
Expand All @@ -165,7 +165,7 @@ components:
RepositoryPullRequests:
# returns '#/components/schemas/pullrequest'
operationId: getPullRequestsByRepository
parameters:
parameters:
username: $response.body#/owner/username
slug: $response.body#/slug
PullRequestMerge:
Expand All @@ -175,29 +175,29 @@ components:
username: $response.body#/author/username
slug: $response.body#/repository/slug
pid: $response.body#/id
schemas:
user:
schemas:
user:
type: object
properties:
username:
properties:
username:
type: string
uuid:
uuid:
type: string
repository:
repository:
type: object
properties:
slug:
properties:
slug:
type: string
owner:
owner:
$ref: '#/components/schemas/user'
pullrequest:
pullrequest:
type: object
properties:
id:
properties:
id:
type: integer
title:
title:
type: string
repository:
repository:
$ref: '#/components/schemas/repository'
author:
author:
$ref: '#/components/schemas/user'
2 changes: 1 addition & 1 deletion openapi3/testdata/lxkns.yaml
@@ -1,6 +1,6 @@
# https://raw.githubusercontent.com/thediveo/lxkns/71e8fb5e40c612ecc89d972d211221137e92d5f0/api/openapi-spec/lxkns.yaml
openapi: 3.0.2
security:
security:
- {}
info:
title: lxkns
Expand Down
2 changes: 1 addition & 1 deletion openapi3filter/testdata/petstore.yaml
Expand Up @@ -38,7 +38,7 @@ paths:
minimum: 1
requestBody:
required: true
content:
content:
'application/json':
schema:
$ref: '#/components/schemas/Pet'
Expand Down