Skip to content

Commit

Permalink
Check for superfluous trailing whitespace (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp committed Oct 13, 2022
1 parent 330c142 commit e95ed34
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 50 deletions.
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

0 comments on commit e95ed34

Please sign in to comment.