Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JSONSchemaGenerator"
uuid = "b10a6b5e-eaef-4b72-b159-8e5005e98e8e"
authors = ["matthijscox <matthijs.cox@gmail.com> and contributors"]
version = "0.3.0"
version = "0.3.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
2 changes: 1 addition & 1 deletion src/JSONSchemaGenerator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function schema(
reference_types = reference_types,
dict_type = dict_type,
)
d = _generate_json_object(schema_type, settings)
d = _generate_json_type_def(schema_type, settings)
return d
end

Expand Down
15 changes: 15 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,18 @@ end
@test_throws Exception bad_combo_schema2 = JSONSchemaGenerator.schema(TestTypes.BadBooleanCombinationSchema2)
end
end

@testset "Vector{T} Regression Test" begin
@testset "Int" begin
int_array_schema = JSONSchemaGenerator.schema(Vector{Int})
@test int_array_schema["type"] == "array"
@test int_array_schema["items"]["type"] == "integer"
end

@testset "Nested" begin
nested_array_schema = JSONSchemaGenerator.schema(Vector{Vector{Int}})
@test nested_array_schema["type"] == "array"
@test nested_array_schema["items"]["type"] == "array"
@test nested_array_schema["items"]["items"]["type"] == "integer"
end
end
Loading