Skip to content

Commit d05cf40

Browse files
authored
Implement URI Template Level 4 expansion (#2151)
Signed-off-by: Juan Cruz Viotti <[email protected]>
1 parent 94ff49b commit d05cf40

24 files changed

+3262
-0
lines changed

.github/workflows/website-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
-DSOURCEMETA_CORE_UUID:BOOL=OFF
2626
-DSOURCEMETA_CORE_REGEX:BOOL=OFF
2727
-DSOURCEMETA_CORE_URI:BOOL=OFF
28+
-DSOURCEMETA_CORE_URITEMPLATE:BOOL=OFF
2829
-DSOURCEMETA_CORE_JSON:BOOL=OFF
2930
-DSOURCEMETA_CORE_JSONL:BOOL=OFF
3031
-DSOURCEMETA_CORE_JSONSCHEMA:BOOL=OFF

.github/workflows/website-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
-DSOURCEMETA_CORE_UUID:BOOL=OFF
3636
-DSOURCEMETA_CORE_REGEX:BOOL=OFF
3737
-DSOURCEMETA_CORE_URI:BOOL=OFF
38+
-DSOURCEMETA_CORE_URITEMPLATE:BOOL=OFF
3839
-DSOURCEMETA_CORE_JSON:BOOL=OFF
3940
-DSOURCEMETA_CORE_JSONL:BOOL=OFF
4041
-DSOURCEMETA_CORE_JSONSCHEMA:BOOL=OFF

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ option(SOURCEMETA_CORE_UUID "Build the Sourcemeta Core UUID library" ON)
1313
option(SOURCEMETA_CORE_MD5 "Build the Sourcemeta Core MD5 library" ON)
1414
option(SOURCEMETA_CORE_REGEX "Build the Sourcemeta Core Regex library" ON)
1515
option(SOURCEMETA_CORE_URI "Build the Sourcemeta Core URI library" ON)
16+
option(SOURCEMETA_CORE_URITEMPLATE "Build the Sourcemeta Core URI Template library" ON)
1617
option(SOURCEMETA_CORE_JSON "Build the Sourcemeta Core JSON library" ON)
1718
option(SOURCEMETA_CORE_JSONSCHEMA "Build the Sourcemeta Core JSON Schema library" ON)
1819
option(SOURCEMETA_CORE_JSONPOINTER "Build the Sourcemeta Core JSON Pointer library" ON)
@@ -100,6 +101,10 @@ if(SOURCEMETA_CORE_URI)
100101
add_subdirectory(src/core/uri)
101102
endif()
102103

104+
if(SOURCEMETA_CORE_URITEMPLATE)
105+
add_subdirectory(src/core/uritemplate)
106+
endif()
107+
103108
if(SOURCEMETA_CORE_JSON)
104109
add_subdirectory(src/core/json)
105110
endif()
@@ -212,6 +217,10 @@ if(SOURCEMETA_CORE_TESTS)
212217
add_subdirectory(test/uri)
213218
endif()
214219

220+
if(SOURCEMETA_CORE_URITEMPLATE)
221+
add_subdirectory(test/uritemplate)
222+
endif()
223+
215224
if(SOURCEMETA_CORE_JSON)
216225
add_subdirectory(test/json)
217226
endif()

DEPENDENCIES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jsonschema-draft1 https://github.com/json-schema-org/json-schema-spec 2072feec9f
1212
jsonschema-draft0 https://github.com/json-schema-org/json-schema-spec 7ea575aef8d5c0183acbe6ff65b4c98ee9c236ec
1313
openapi https://github.com/OAI/OpenAPI-Specification 74906beddddab9e555337031b2a8d8e9338c4972
1414
referencing-suite https://github.com/python-jsonschema/referencing-suite 61c4cc202b1e96ed5adcaf4842a595f68d659212
15+
uritemplate-test https://github.com/uri-templates/uritemplate-test 1eb27ab4462b9e5819dc47db99044f5fd1fa9bc7
1516
yaml https://github.com/yaml/libyaml 0.2.5
1617
pcre2 https://github.com/PCRE2Project/pcre2 pcre2-10.47
1718
googletest https://github.com/google/googletest a7f443b80b105f940225332ed3c31f2790092f47

config.cmake.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ if(NOT SOURCEMETA_CORE_COMPONENTS)
1414
list(APPEND SOURCEMETA_CORE_COMPONENTS md5)
1515
list(APPEND SOURCEMETA_CORE_COMPONENTS regex)
1616
list(APPEND SOURCEMETA_CORE_COMPONENTS uri)
17+
list(APPEND SOURCEMETA_CORE_COMPONENTS uritemplate)
1718
list(APPEND SOURCEMETA_CORE_COMPONENTS json)
1819
list(APPEND SOURCEMETA_CORE_COMPONENTS jsonl)
1920
list(APPEND SOURCEMETA_CORE_COMPONENTS jsonpointer)
@@ -52,6 +53,8 @@ foreach(component ${SOURCEMETA_CORE_COMPONENTS})
5253
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_core_regex.cmake")
5354
elseif(component STREQUAL "uri")
5455
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_core_uri.cmake")
56+
elseif(component STREQUAL "uritemplate")
57+
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_core_uritemplate.cmake")
5558
elseif(component STREQUAL "json")
5659
find_dependency(mpdecimal CONFIG)
5760
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_core_numeric.cmake")
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sourcemeta_library(NAMESPACE sourcemeta PROJECT core NAME uritemplate
2+
PRIVATE_HEADERS error.h
3+
SOURCES
4+
helpers.h
5+
uritemplate.cc)
6+
7+
if(SOURCEMETA_CORE_INSTALL)
8+
sourcemeta_library_install(NAMESPACE sourcemeta PROJECT core NAME uritemplate)
9+
endif()

0 commit comments

Comments
 (0)