feat: fixes improper json when creating a project using a repository
This commit is contained in:
@@ -70,11 +70,15 @@ private struct TemplateRepo: Encodable {
|
||||
let template: Template
|
||||
|
||||
init(repo: String, version: String?) {
|
||||
self.template = .init(repo: repo, version: version ?? "main")
|
||||
self.template = .init(repo: .init(url: repo, version: version ?? "main"))
|
||||
}
|
||||
|
||||
struct Template: Encodable {
|
||||
let repo: String
|
||||
let repo: Repo
|
||||
}
|
||||
|
||||
struct Repo: Encodable {
|
||||
let url: String
|
||||
let version: String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,10 +233,12 @@ struct CliClientTests: TestCase {
|
||||
expectation: .success("""
|
||||
{
|
||||
"template" : {
|
||||
"repo" : "https://git.example.com/template.git",
|
||||
"repo" : {
|
||||
"url" : "https://git.example.com/template.git",
|
||||
"version" : "main"
|
||||
}
|
||||
}
|
||||
}
|
||||
""")
|
||||
),
|
||||
GenerateJsonTestOption(
|
||||
@@ -250,10 +252,12 @@ struct CliClientTests: TestCase {
|
||||
expectation: .success("""
|
||||
{
|
||||
"template" : {
|
||||
"repo" : "https://git.example.com/template.git",
|
||||
"repo" : {
|
||||
"url" : "https://git.example.com/template.git",
|
||||
"version" : "v0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
""")
|
||||
)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user