Skip to content

Switch to Idiomatic Swift Naming Convention #114

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 46 commits into from
May 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3157e8d
Use idiomatic naming strategy
ryansobol May 1, 2025
a4f3a25
Commit via running ake Submodule
ryansobol May 1, 2025
ced52c8
Commit via running ake Sources/actions
ryansobol May 1, 2025
abc3239
Commit via running ake Sources/activity
ryansobol May 1, 2025
b499fb2
Commit via running ake Sources/apps
ryansobol May 1, 2025
3033398
Commit via running ake Sources/billing
ryansobol May 1, 2025
f5581d3
Commit via running ake Sources/checks
ryansobol May 1, 2025
531d1d9
Commit via running ake Sources/code-scanning
ryansobol May 1, 2025
e0d86fc
Commit via running ake Sources/codes-of-conduct
ryansobol May 1, 2025
1a1a5f8
Commit via running ake Sources/emojis
ryansobol May 1, 2025
7a0e573
Commit via running ake Sources/dependabot
ryansobol May 1, 2025
04f9a91
Commit via running ake Sources/dependency-graph
ryansobol May 1, 2025
23951e8
Commit via running ake Sources/gists
ryansobol May 1, 2025
7da2c01
Commit via running ake Sources/git
ryansobol May 1, 2025
695472c
Commit via running ake Sources/gitignore
ryansobol May 1, 2025
90c06bf
Commit via running ake Sources/issues
ryansobol May 1, 2025
3f0d516
Commit via running ake Sources/licenses
ryansobol May 1, 2025
52bfab2
Commit via running ake Sources/markdown
ryansobol May 1, 2025
6e95cd2
Commit via running ake Sources/merge-queue
ryansobol May 1, 2025
f7298b3
Commit via running ake Sources/meta
ryansobol May 1, 2025
6f5cf46
Commit via running ake Sources/migrations
ryansobol May 1, 2025
2039ad5
Commit via running ake Sources/oidc
ryansobol May 1, 2025
853b3ee
Commit via running ake Sources/orgs
ryansobol May 1, 2025
b92e764
Commit via running ake Sources/packages
ryansobol May 1, 2025
472f289
Commit via running ake Sources/projects
ryansobol May 1, 2025
bac994b
Commit via running ake Sources/pulls
ryansobol May 1, 2025
54c5482
Commit via running ake Sources/rate-limit
ryansobol May 1, 2025
d82444a
Commit via running ake Sources/reactions
ryansobol May 1, 2025
35fd004
Commit via running ake Sources/repos
ryansobol May 1, 2025
e9277b3
Commit via running ake Sources/search
ryansobol May 1, 2025
ae04356
Commit via running ake Sources/secret-scanning
ryansobol May 1, 2025
3ff21a4
Commit via running ake Sources/teams
ryansobol May 1, 2025
a771acc
Commit via running ake Sources/users
ryansobol May 1, 2025
4c68aae
Commit via running ake Sources/codespaces
ryansobol May 1, 2025
31ea9f5
Commit via running ake Sources/copilot
ryansobol May 1, 2025
bb9db1e
Commit via running ake Sources/security-advisories
ryansobol May 1, 2025
97e9ec6
Commit via running ake Sources/interactions
ryansobol May 1, 2025
15c36d0
Commit via running ake Sources/classroom
ryansobol May 1, 2025
3e783e1
Commit via running ake Sources/desktop
ryansobol May 1, 2025
9c569c9
Commit via running ake Sources/enterprise-teams
ryansobol May 1, 2025
7882e6e
Commit via running ake Sources/code-security
ryansobol May 1, 2025
56693fe
Commit via running ake Sources/private-registries
ryansobol May 1, 2025
0eb8e61
Commit via running ake Sources/hosted-compute
ryansobol May 1, 2025
0880bc7
Commit via running ake Sources/campaigns
ryansobol May 1, 2025
40d3e0a
Update README
ryansobol May 1, 2025
0f65313
Migrate deprecated Servers.server1() calls to the new Servers.Server1…
ryansobol May 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Mintfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
yonaskolb/Mint@0.17.5
apple/swift-openapi-generator@1.2.1
apple/swift-openapi-generator@1.7.2
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import GitHubRestAPIUsers
import OpenAPIRuntime
import OpenAPIURLSession

let client = Client(serverURL: try Servers.server1(), transport: URLSessionTransport())
let users = try await client.users_sol_list().ok.body.json
let client = Client(serverURL: try Servers.Server1.url(), transport: URLSessionTransport())
let users = try await client.usersList().ok.body.json
```

<details>
Expand Down Expand Up @@ -91,23 +91,23 @@ struct GitHubRestAPIIssuesExtension {
let newBody = "\(body)\n\n\(hidingContent)"

let client = Client(
serverURL: try Servers.server1(),
serverURL: try Servers.Server1.url(),
transport: URLSessionTransport(),
middlewares: [AuthenticationMiddleware(token: nil)]
)

let comments = try await client.issues_sol_list_hyphen_comments(
path: .init(owner: owner, repo: repo, issue_number: number)
let comments = try await client.issuesListComments(
path: .init(owner: owner, repo: repo, issueNumber: number)
).ok.body.json

if let comment = comments.first(where: { $0.body?.contains(hidingContent) == true }) {
_ = try await client.issues_sol_update_hyphen_comment(
path: .init(owner: owner, repo: repo, comment_id: Components.Parameters.comment_hyphen_id(comment.id)),
_ = try await client.issuesUpdateComment(
path: .init(owner: owner, repo: repo, commentId: comment.id),
body: .json(.init(body: newBody))
)
} else {
_ = try await client.issues_sol_create_hyphen_comment(
path: .init(owner: owner, repo: repo, issue_number: number),
_ = try await client.issuesCreateComment(
path: .init(owner: owner, repo: repo, issueNumber: number),
body: .json(.init(body: newBody))
)
}
Expand All @@ -130,7 +130,7 @@ import HTTPTypes
let token: String = "***"

let client = Client(
serverURL: try Servers.server1(),
serverURL: try Servers.Server1.url(),
transport: URLSessionTransport(),
middlewares: [AuthenticationMiddleware(token: token)]
)
Expand Down
7 changes: 6 additions & 1 deletion Scripts/GeneratorConfigBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ struct GeneratorConfigBuilder {
- \#(tagString)

accessModifier: public

namingStrategy: idiomatic

nameOverrides:
'reactions-+1': reactionsThumbsUp
'reactions--1': reactionsThumbsDown
"""#
}

Expand Down Expand Up @@ -59,4 +65,3 @@ if let argTag = CommandLine.arguments[1]
} else {
throw ErrorMessage(message: "No tag not found.")
}

1,526 changes: 763 additions & 763 deletions Sources/actions/Client.swift

Large diffs are not rendered by default.

14,591 changes: 7,508 additions & 7,083 deletions Sources/actions/Types.swift

Large diffs are not rendered by default.

446 changes: 223 additions & 223 deletions Sources/activity/Client.swift

Large diffs are not rendered by default.

5,839 changes: 3,020 additions & 2,819 deletions Sources/activity/Types.swift

Large diffs are not rendered by default.

594 changes: 297 additions & 297 deletions Sources/apps/Client.swift

Large diffs are not rendered by default.

5,651 changes: 2,902 additions & 2,749 deletions Sources/apps/Types.swift

Large diffs are not rendered by default.

76 changes: 38 additions & 38 deletions Sources/billing/Client.swift

Large diffs are not rendered by default.

805 changes: 407 additions & 398 deletions Sources/billing/Types.swift

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions Sources/campaigns/Client.swift

Large diffs are not rendered by default.

1,097 changes: 561 additions & 536 deletions Sources/campaigns/Types.swift

Large diffs are not rendered by default.

160 changes: 80 additions & 80 deletions Sources/checks/Client.swift

Large diffs are not rendered by default.

2,921 changes: 1,465 additions & 1,456 deletions Sources/checks/Types.swift

Large diffs are not rendered by default.

76 changes: 38 additions & 38 deletions Sources/classroom/Client.swift

Large diffs are not rendered by default.

803 changes: 406 additions & 397 deletions Sources/classroom/Types.swift

Large diffs are not rendered by default.

518 changes: 270 additions & 248 deletions Sources/code-scanning/Client.swift

Large diffs are not rendered by default.

4,382 changes: 2,257 additions & 2,125 deletions Sources/code-scanning/Types.swift

Large diffs are not rendered by default.

358 changes: 179 additions & 179 deletions Sources/code-security/Client.swift

Large diffs are not rendered by default.

4,231 changes: 2,160 additions & 2,071 deletions Sources/code-security/Types.swift

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions Sources/codes-of-conduct/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ public struct Client: APIProtocol {
///
/// - Remark: HTTP `GET /codes_of_conduct`.
/// - Remark: Generated from `#/paths//codes_of_conduct/get(codes-of-conduct/get-all-codes-of-conduct)`.
public func codes_hyphen_of_hyphen_conduct_sol_get_hyphen_all_hyphen_codes_hyphen_of_hyphen_conduct(_ input: Operations.codes_hyphen_of_hyphen_conduct_sol_get_hyphen_all_hyphen_codes_hyphen_of_hyphen_conduct.Input) async throws -> Operations.codes_hyphen_of_hyphen_conduct_sol_get_hyphen_all_hyphen_codes_hyphen_of_hyphen_conduct.Output {
public func codesOfConductGetAllCodesOfConduct(_ input: Operations.CodesOfConductGetAllCodesOfConduct.Input) async throws -> Operations.CodesOfConductGetAllCodesOfConduct.Output {
try await client.send(
input: input,
forOperation: Operations.codes_hyphen_of_hyphen_conduct_sol_get_hyphen_all_hyphen_codes_hyphen_of_hyphen_conduct.id,
forOperation: Operations.CodesOfConductGetAllCodesOfConduct.id,
serializer: { input in
let path = try converter.renderedPath(
template: "/codes_of_conduct",
Expand All @@ -68,7 +68,7 @@ public struct Client: APIProtocol {
switch response.status.code {
case 200:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.codes_hyphen_of_hyphen_conduct_sol_get_hyphen_all_hyphen_codes_hyphen_of_hyphen_conduct.Output.Ok.Body
let body: Operations.CodesOfConductGetAllCodesOfConduct.Output.Ok.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
Expand All @@ -78,7 +78,7 @@ public struct Client: APIProtocol {
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
[Components.Schemas.code_hyphen_of_hyphen_conduct].self,
[Components.Schemas.CodeOfConduct].self,
from: responseBody,
transforming: { value in
.json(value)
Expand Down Expand Up @@ -108,10 +108,10 @@ public struct Client: APIProtocol {
///
/// - Remark: HTTP `GET /codes_of_conduct/{key}`.
/// - Remark: Generated from `#/paths//codes_of_conduct/{key}/get(codes-of-conduct/get-conduct-code)`.
public func codes_hyphen_of_hyphen_conduct_sol_get_hyphen_conduct_hyphen_code(_ input: Operations.codes_hyphen_of_hyphen_conduct_sol_get_hyphen_conduct_hyphen_code.Input) async throws -> Operations.codes_hyphen_of_hyphen_conduct_sol_get_hyphen_conduct_hyphen_code.Output {
public func codesOfConductGetConductCode(_ input: Operations.CodesOfConductGetConductCode.Input) async throws -> Operations.CodesOfConductGetConductCode.Output {
try await client.send(
input: input,
forOperation: Operations.codes_hyphen_of_hyphen_conduct_sol_get_hyphen_conduct_hyphen_code.id,
forOperation: Operations.CodesOfConductGetConductCode.id,
serializer: { input in
let path = try converter.renderedPath(
template: "/codes_of_conduct/{}",
Expand All @@ -134,7 +134,7 @@ public struct Client: APIProtocol {
switch response.status.code {
case 200:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Operations.codes_hyphen_of_hyphen_conduct_sol_get_hyphen_conduct_hyphen_code.Output.Ok.Body
let body: Operations.CodesOfConductGetConductCode.Output.Ok.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
Expand All @@ -144,7 +144,7 @@ public struct Client: APIProtocol {
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.code_hyphen_of_hyphen_conduct.self,
Components.Schemas.CodeOfConduct.self,
from: responseBody,
transforming: { value in
.json(value)
Expand All @@ -156,7 +156,7 @@ public struct Client: APIProtocol {
return .ok(.init(body: body))
case 404:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.not_found.Body
let body: Components.Responses.NotFound.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
Expand All @@ -166,7 +166,7 @@ public struct Client: APIProtocol {
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.basic_hyphen_error.self,
Components.Schemas.BasicError.self,
from: responseBody,
transforming: { value in
.json(value)
Expand Down
Loading