Skip to content

Generate OpenAPI OFREP client #1

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

Merged
merged 3 commits into from
Dec 13, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/soundness.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,15 @@ jobs:
SWIFTLY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run format check
run: ./scripts/check-swift-format.sh

broken-symlinks-check:
name: Broken symlinks check
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Run broken symlinks check
run: ./scripts/check-broken-symlinks.sh
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "protocol"]
path = protocol
url = https://github.com/open-feature/protocol
5 changes: 5 additions & 0 deletions .licenseignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
.gitignore
.licenseignore
.unacceptablelanguageignore
.swiftformatignore
.swift-format
.editorconfig
*.md
*.txt
*.yaml
Package.swift
.gitmodules
protocol/
Makefile
*/Generated/**
1 change: 1 addition & 0 deletions .swiftformatignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sources/OFREP/Generated
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Code generation
# -----------------------------------------------------------------------------
OPENAPI_SPEC = protocol/service/openapi.yaml
OPENAPI_GEN_SWIFT = .build/debug/swift-openapi-generator
GEN_SWIFT_ROOT = Sources/OFREP/Generated
GEN_SWIFTS = $(GEN_SWIFT_ROOT)/Types.swift,$(GEN_SWIFT_ROOT)/Client.swift

$(OPENAPI_GEN_SWIFT):
swift build --product swift-openapi-generator

$(GEN_SWIFTS): $(OPENAPI_SPEC) $(OPENAPI_GEN_SWIFT)
@mkdir -pv $(GEN_SWIFT_ROOT)
$(OPENAPI_GEN_SWIFT) generate \
$(OPENAPI_SPEC) \
--mode types \
--mode client \
--output-directory $(GEN_SWIFT_ROOT)

.PHONY: generate
generate: $(GEN_SWIFTS)
5 changes: 4 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ let package = Package(
.library(name: "OFREP", targets: ["OFREP"])
],
dependencies: [
.package(url: "https://github.com/swift-open-feature/swift-open-feature.git", branch: "main")
.package(url: "https://github.com/swift-open-feature/swift-open-feature.git", branch: "main"),
.package(url: "https://github.com/apple/swift-openapi-generator.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-openapi-runtime.git", from: "1.0.0"),
],
targets: [
.target(
name: "OFREP",
dependencies: [
.product(name: "OpenFeature", package: "swift-open-feature"),
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
]
),
.testTarget(
Expand Down
Loading
Loading