-
Notifications
You must be signed in to change notification settings - Fork 9
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
Model Setup for String Catalog #14
Model Setup for String Catalog #14
Conversation
@Uni-boy is your PR ready for review please? |
Yeah my PR is ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we just add some passive data models without using them?
I recommend taking a look at closed PRs. See what kind of PRs are merged and what kind of PRs are rejected.
} | ||
|
||
struct StringInfo: Decodable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it the best practice to put all struct
s in the same source file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, these structs should be consumed. Please check my previous comments: #14 (review)
@Uni-boy if you don't have any plan to update this PR, please feel free to close it. Thank you. |
I finalized the model and all tests passed. |
Please merge from More importantly, when I said "these structs should be consumed", I meant the |
…to feature/create-decodable-models
I applied the model to main.swift and solved the TODO in StringEnumHelper.swift |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the obvious issues I pointed out, but my PR review is not finished yet. I'll add another review soon.
.github/PULL_REQUEST_TEMPLATE.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete xcode related files from git. You shouldn't use xcode for this project, but if you insist doing so (not recommended, I can see a sample xcode project being added in future, but not for the CLI tool itself), you can add this file to .gitignore
.
// let variations: Variations? | ||
} | ||
|
||
// struct Variations: Decodable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are dead codes too but I'll need to further look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there! Just a few minor suggestions.
StringCatalogEnum/Sources/StringCatalogEnumLibrary/StringEnumHelper.swift
Outdated
Show resolved
Hide resolved
StringCatalogEnum/Sources/StringCatalogEnumLibrary/StringEnumHelper.swift
Outdated
Show resolved
Hide resolved
StringCatalogEnum/Sources/StringCatalogEnumLibrary/StringEnumHelper.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address this: #14 (comment)
And added some other suggestions regarding unit tests. Sorry I forgot them in my previous review.
let decoder = JSONDecoder() | ||
expect{ | ||
try decoder.decode(Localizations.self, from: jsonData) | ||
}.toNot(throwError()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing: could you add some to(equal())
evaluation please?
}, | ||
"version" : "1.0" | ||
} | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
|
||
// Verify the contents of 'strings' dictionary | ||
expect(decodedData.strings["Login"]).toNot(beNil()) | ||
expect(decodedData.strings["Login"]?.localizations?["en"]?.stringUnit?.state).to(equal("translated")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually we want to use Decodable
for all these JSON objects, but this PR is good as is.
#1
I implemented the model according to the Json data listed in issue, but the actual json is more complex, so I commented out the model made for those extra attributes.