Skip to content
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

Changes in Swift-Codable.json for nil/not found key-value pairs. #140

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d6f592d
Merge pull request #88 from AlexxNica/patch-1
Ahmed-Ali Nov 15, 2017
bf8134e
Merge pull request #96 from kashifshaikh/master
Ahmed-Ali Nov 15, 2017
16893c7
Merge pull request #93 from narlei/master
Ahmed-Ali Nov 15, 2017
c5a4da4
fix a complier error in SwiftyJSON - Class
superk589 Nov 27, 2017
779a06f
Migrate to Swift 4
serhii-londar Dec 13, 2017
e40b258
Added Swift-Codable-Struct with forced unwrapped option
mumer92 Dec 26, 2017
2f8ba42
added back credit file
mumer92 Dec 26, 2017
df54d97
Change generic type from 'AnyObject' to 'String' -> Fixes #105
Feb 12, 2018
8528d6a
Java Gson for Android: Fix method name to be "optString" instead of "…
Mar 3, 2018
02a96ed
Fix: float type issue
Mar 3, 2018
4c61a93
Update to Swift 4.2
BrychanOdlum Oct 2, 2018
0a3d17f
Updating GHANGELOG.md for release 1.0.9
Ahmed-Ali Nov 24, 2018
cdd8a4f
Merge branch 'master' of git://github.com/superk589/JSONExport into s…
Ahmed-Ali Nov 24, 2018
3b306da
Merge branch 'superk589-master' into develop
Ahmed-Ali Nov 24, 2018
30d8785
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
8e804f6
Merge branch 'master' of git://github.com/serhii-londar/JSONExport in…
Ahmed-Ali Nov 24, 2018
8069c92
Merge branch 'serhii-londar-master'
Ahmed-Ali Nov 24, 2018
a45d1ae
Merge branch 'serhii-londar-master' into develop
Ahmed-Ali Nov 24, 2018
c20cabb
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
2c3864f
Merge branch 'master' of git://github.com/mumer92/JSONExport into mum…
Ahmed-Ali Nov 24, 2018
330d94b
Merge branch 'mumer92-master' into develop
Ahmed-Ali Nov 24, 2018
9ca6bdc
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
a9b4ca0
Merge branch 'fix_generic_type_swift_struct_codable' of git://github.…
Ahmed-Ali Nov 24, 2018
870ee94
Merge branch 'ankushkushwaha-fix_generic_type_swift_struct_codable' i…
Ahmed-Ali Nov 24, 2018
0c5bd0d
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
790b7fb
Merge branch 'feature/fix_java_gson_for_android' of git://github.com/…
Ahmed-Ali Nov 24, 2018
96d1f27
Merge branch 'ty0521-fss-feature/fix_java_gson_for_android' into develop
Ahmed-Ali Nov 24, 2018
1e806c9
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
a0a7c7e
Merge branch 'master' of git://github.com/BrychanOdlum/JSONExport int…
Ahmed-Ali Nov 24, 2018
101a4e9
Merge branch 'BrychanOdlum-master' into develop
Ahmed-Ali Nov 24, 2018
87f71cb
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
a507ecf
Fixing the project file
Ahmed-Ali Nov 24, 2018
db500f5
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
47a897e
Adding Outlaw JSON file to the project as the merge conflicts caused …
Ahmed-Ali Nov 24, 2018
a0ec494
nit: removing empty line
Ahmed-Ali Nov 24, 2018
50e3f93
Fixed an issue with trying to figure the selected language from an UI…
Ahmed-Ali Nov 24, 2018
fe313c0
fixed: update the color under Dark Mode
Sep 6, 2019
ec2051d
Merge pull request #136 from hzb/master
huabin Sep 8, 2019
1545cbe
Changed code in swift codable so that if any key value pair is not fo…
pawan-joshi Dec 24, 2019
427f41a
swift formatted
pawan-joshi Dec 24, 2019
54e9ead
Formatting changed for some swift model jsons
pawan-joshi Jul 23, 2020
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 JSONExport/HeaderFileRepresenter.swift
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ class HeaderFileRepresenter : FileRepresenter{
}

fileContent += ". All rights reserved.\n//\n\n"
fileContent += "//\tModel file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport\n\n"
//fileContent += "//\tModel file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport\n\n"
}

}
105 changes: 105 additions & 0 deletions JSONExport/Swift-Codable-Unwrapped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"modelStart": "{\n",
"importForEachCustomType": "",
"reservedKeywords": [
"abstract",
"assert",
"boolean",
"break",
"byte",
"case",
"catch",
"char",
"class",
"const",
"continue",
"default",
"do",
"double",
"else",
"enum",
"extends",
"false",
"final",
"finally",
"float",
"for",
"goto",
"if",
"implements",
"import",
"instanceof",
"int",
"interface",
"long",
"native",
"new",
"null",
"package",
"private",
"protected",
"public",
"return",
"short",
"static",
"strictfp",
"super",
"switch",
"synchronized",
"this",
"throw",
"throws",
"transient",
"true",
"try",
"void",
"volatile",
"while",
"class",
"description"
],
"booleanGetter": "",
"briefDescription": "Defines how your JSON objects can be mapped to Swift structures using the built-in NSJSONSerialization class",
"utilityMethods": [
],
"dataTypes": {
"stringType": "String",
"boolType": "Bool",
"floatType": "Float",
"doubleType": "Double",
"characterType": "Character",
"longType": "Double",
"intType": "Int"
},
"wordsToRemoveToGetArrayElementsType": [
"[",
"]"
],
"constructors": [
{
"fetchBasicTypeWithSpecialNeedsPropertyFromMap": "",
"bodyStart": "{\n",
"body": "",
"bodyEnd": "\t}\n",
"fetchBasicTypePropertyFromMap": "\t\tcase <!VarName!> = \"<!JsonKeyName!>\"\n",
"signature": "\tenum CodingKeys: String, CodingKey ",
"fetchArrayOfCustomTypePropertyFromMap": "\t\tcase <!VarName!> = \"<!JsonKeyName!>\"\n",
"comment": "",
"fetchCustomTypePropertyFromMap": "\t\tcase <!VarName!>\n"
}
],
"modelDefinition": "\nstruct <!ModelName!> : Codable ",
"genericType": "AnyObject",
"getter": "",
"setter": "",
"fileExtension": "swift",
"arrayType": "[<!ElementType!>]",
"basicTypesWithSpecialFetchingNeeds": [
],
"displayLangName": "Swift - Struct - Codable - Unwrapped",
"instanceVarDefinition": "\tlet <!VarName!> : <!VarType!>\n",
"supportsFirstLineStatement": "false",
"modelEnd": "\n}",
"staticImports": "import Foundation",
"langName": "Swift"
}
4 changes: 2 additions & 2 deletions JSONExport/ViewController.swift
Original file line number Diff line number Diff line change
@@ -386,7 +386,7 @@ class ViewController: NSViewController, NSUserNotificationCenterDelegate, NSTabl
saveButton.isEnabled = false
var str = sourceText.string

if str.characters.count == 0{
if str.count == 0{
runOnUiThread{
//Nothing to do, just clear any generated files
self.files.removeAll(keepingCapacity: false)
@@ -395,7 +395,7 @@ class ViewController: NSViewController, NSUserNotificationCenterDelegate, NSTabl
return;
}
var rootClassName = classNameField.stringValue
if rootClassName.characters.count == 0{
if rootClassName.count == 0{
rootClassName = "RootClass"
}
sourceText.isEditable = false