spezimockwebservice
A Spezi-based Swift Package to mock the interaction with a web service in a Spezi-based app.
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.7%) to scientific vocabulary
Repository
A Spezi-based Swift Package to mock the interaction with a web service in a Spezi-based app.
Basic Info
- Host: GitHub
- Owner: StanfordSpezi
- License: mit
- Language: Swift
- Default Branch: main
- Homepage: https://swiftpackageindex.com/StanfordSpezi/SpeziMockWebService/documentation
- Size: 1.11 MB
Statistics
- Stars: 3
- Watchers: 10
- Forks: 1
- Open Issues: 5
- Releases: 7
Metadata Files
README.md
SpeziMockWebService
Mock the interaction with a web service in a Spezi-based application.
Overview
The Spezi Mock Web Service Swift Package provides a Spezi Module (MockWebService) to mock the interaction with a web service and display the requests in a user interface that can be used for demonstrations and debugging purposes (RequestList).
|
|
|
|
|:---:|:---:|:---:|
| The landing page of the RequestList | The RequestList provides an overview of all sent requests. | The detail view of a single request. |
Setup
1. Add Spezi Mock Web Service as a Dependency
You need to add the Spezi Mock Web Service Swift package to your app in Xcode or Swift package.
[!IMPORTANT]
If your application is not yet configured to use Spezi, follow the Spezi setup article setup the core Spezi infrastructure.
2. Register the Module
The MockWebService module needs
to be registered in a Spezi-based application using the
configuration in a
SpeziAppDelegate:
swift
class ExampleAppDelegate: SpeziAppDelegate {
override var configuration: Configuration {
Configuration {
MockWebService()
// ...
}
}
}
[!NOTE]
You can learn more about aModulein the Spezi documentation.
Example
The following example demonstrates the usage of the Swift Package in a SwiftUI View,
accessing the MockWebService
using the @Environment property wrapper.
```swift import SpeziMockWebService import SwiftUI
struct ExampleView: View { @Environment(MockWebService.self) var webService: MockWebService
var body: some View {
NavigationStack {
RequestList()
// ...
}
}
private func sendMockUploadRequests() async throws {
try await webService.upload(path: "Test", body: #"{"test": "test"}"#)
try await webService.remove(path: "TestRemoval")
}
} ```
For more information, please refer to the API documentation.
Contributing
Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.
License
This project is licensed under the MIT License. See Licenses for more information.

Owner
- Name: Stanford Spezi
- Login: StanfordSpezi
- Kind: organization
- Repositories: 1
- Profile: https://github.com/StanfordSpezi
Citation (CITATION.cff)
# # This source file is part of the Stanford Spezi open source project # # SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md) # # SPDX-License-Identifier: MIT # cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Schmiedmayer" given-names: "Paul" orcid: "https://orcid.org/0000-0002-8607-9148" title: "SpeziMockWebService" doi: 10.5281/zenodo.8239945 url: "https://github.com/StanfordSpezi/SpeziMockWebService"
GitHub Events
Total
- Issues event: 1
Last Year
- Issues event: 1
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 6
- Total pull requests: 10
- Average time to close issues: 2 months
- Average time to close pull requests: about 1 hour
- Total issue authors: 1
- Total pull request authors: 3
- Average comments per issue: 0.5
- Average comments per pull request: 0.9
- Merged pull requests: 10
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: 7 minutes
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 1.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- PSchmiedmayer (5)
Pull Request Authors
- PSchmiedmayer (5)
- Supereg (4)
- vishnuravi (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 7
swiftpackageindex.com: github.com/StanfordSpezi/SpeziMockWebService
A Spezi-based Swift Package to mock the interaction with a web service in a Spezi-based app.
- Homepage: https://swiftpackageindex.com/StanfordSpezi/SpeziMockWebService/documentation
- Documentation: https://swiftpackageindex.com/StanfordSpezi/SpeziMockWebService/documentation
- License: mit
-
Latest release: 1.0.0
published about 2 years ago