Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neudinger/jsontoswift
Source 2 Source Transpiler. Convert Json file to Struct swift file
https://github.com/neudinger/jsontoswift
ios json json-schema swift swift-language ubuntu
Last synced: 4 days ago
JSON representation
Source 2 Source Transpiler. Convert Json file to Struct swift file
- Host: GitHub
- URL: https://github.com/neudinger/jsontoswift
- Owner: neudinger
- License: gpl-3.0
- Created: 2018-04-16T09:51:07.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-16T11:33:54.000Z (almost 7 years ago)
- Last Synced: 2025-01-20T09:09:04.506Z (4 days ago)
- Topics: ios, json, json-schema, swift, swift-language, ubuntu
- Language: Swift
- Homepage: https://neudinger.github.io/JsonToSwift/
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JsonToSwift
A description of this package.
## Getting Started
* This script is Tongji University IOS/Swift project.
* Convert Json Document to Swift Structure.### Prerequisites
You need to have swift installed on your computer.
* [Swift](https://swift.org/getting-started/#installing-swift) - MacOS & Ubuntu
* [Swift-docker](https://github.com/swiftdocker/docker-swift) - Linux without Ubuntu## Running
```
cat data.json | swift run jsontoswift > struct.swift
``````
// create struct with initial values
var obj = JsonObject()// create struct with json parameter values
let jsonFile: String = "{\"answer\": 42, \"hello\": \"world\"}"
let jsonData = jsonFile.data(using: .utf8)
let json = try? JSONSerialization.jsonObject(with: jsonData!, options: .mutableLeaves)
var objprime = JsonObject(json)print(obj)
print(objprime)
```## Authors
* **Barre Kevin** - *Initial work* - [neudinger](https://github.com/neudinger)
## Code Style and Optimisation
I learned SWIFT language and write this project in 2 days.
You can use this for personal project. But don't use for professional project because is just school project.
So may be the code is not awesome but i will never touch this proprietary language again.
## License
This project is licensed under the GNU GENERAL PUBLIC LICENSE
Version 3 - see the [GNU GPL3](LICENSE) file for details## Epitech Cheater
Please understand the project and the swift language
don't copy - paste foolishly.Skills & Experiences > School Ranking