yutomizutani / jsontocodable Goto Github PK
View Code? Open in Web Editor NEWA generating tool from Raw JSON to Codable (Swift4) text written in Swift4.
License: MIT License
A generating tool from Raw JSON to Codable (Swift4) text written in Swift4.
License: MIT License
Add support format
Like this: https://github.com/ChimeraCoder/gojson
Add codecov.yml
$ curl https://httpbin.org/get | jc > Result.swift
func generate(_ url: URLConvertible, method, parameters, resultHandler: (String -> ())) throws
and
JSONtoCodable().generate(from: "https://httpbin.org") { generatedCodable in
print(generatedCodable)
}
Demo
-> `` (Could not set lib name)
@
and some symbols escaping with keys and add config options escaping _
Add support types
Type of "array" returns "[Any]" in this case,
{
"Object": {
"array": [
1,
2,
3,
]
}
}
It is a generating tool, the name is BAD.
For japanese docs
And add on released page
How to improve presentation?
I guess a new function mergeStructs(_ text: String) -> String
on v2.0.0 is merge multiple struct
scopes, so to be public to open for users.
{
"hello": "Hello, \"world!!\""
}
public let do: String
case do = "DO"
public let `do`: String
case `do` = "DO"
func testDecisionType() {
XCTAssertEqual(self.base.decisionType("True", isString: true), .string)
XCTAssertEqual(self.base.decisionType("false", isString: true), .string)
XCTAssertEqual(self.base.decisionType("0", isString: true), .string)
XCTAssertEqual(self.base.decisionType("-10", isString: true), .string)
XCTAssertEqual(self.base.decisionType("1000", isString: true), .string)
XCTAssertEqual(self.base.decisionType("1.0", isString: true), .string)
XCTAssertEqual(self.base.decisionType("-10.0", isString: true), .string)
XCTAssertEqual(self.base.decisionType("1000.5", isString: true), .string)
XCTAssertEqual(self.base.decisionType("nil", isString: true), .string)
XCTAssertEqual(self.base.decisionType("NULL", isString: true), .string)
XCTAssertEqual(self.base.decisionType("Hello", isString: true), .string)
XCTAssertEqual(self.base.decisionType("True", isString: false), .bool)
XCTAssertEqual(self.base.decisionType("false", isString: false), .bool)
XCTAssertEqual(self.base.decisionType("0", isString: false), .int)
XCTAssertEqual(self.base.decisionType("-10", isString: false), .int)
XCTAssertEqual(self.base.decisionType("1000", isString: false), .int)
XCTAssertEqual(self.base.decisionType("1.0", isString: false), .double)
XCTAssertEqual(self.base.decisionType("-10.0", isString: false), .double)
XCTAssertEqual(self.base.decisionType("1000.5", isString: false), .double)
XCTAssertEqual(self.base.decisionType("nil", isString: false), .optionalAny)
XCTAssertEqual(self.base.decisionType("NULL", isString: false), .optionalAny)
XCTAssertEqual(self.base.decisionType("Hello", isString: false), .any)
}
These do not conform to protocol 'Decodable'.
To Codable.
-> to Codable.
on README
JSONtoCodable
jc
Modifer
-> Modifier
'JSONtoCodable' initializer is inaccessible due to 'internal' protection level
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.