Commit Graph

45 Commits

Author SHA1 Message Date
Cristian Le
1242ae1a4a
Revert library name change (#271)
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2023-05-16 13:44:17 +02:00
Cristian Le
0d60d48a58
Modernize cmake script (#262)
* Remove travis file
* Apply pre-commit fixes
* Modernize cmake file

- Added JSON_VALIDATOR_SHARED_LIBS to properly handle shared-library
- Bumped minimum cmake to 3.11 to use no-source add_library
- Bumped minimum cmake to 3.14 to properly support FetchContent (FetchContent_MakeAvailable)
- Converted Hunter package manager to FetchContent (It is plenty mature these days)
- Added namespace to exported target
- Made the cmake file compatible with FetchContent

* Use simplified FetchContent CI
* Add simple status messages
* Handle nlohmann dependency

Not an ideal approach, but required in order for the exported target to have appropriate linkage.
Maybe this can be designed to become a PRIVATE link library, but then how does it ensure the target is installed?

* Remove CMake-install test

This will be moved to packaging integration tests

* Enable code coverage

* Reconfigure ci presets

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
2023-05-11 12:07:56 +02:00
Patrick Boettcher
6b17782d6a update to SOVERSION to 2 (as it should have been done 3 years ago)
fix #186
2022-11-26 18:06:09 +01:00
Patrick Boettcher
96a4255938 bump to 2.2.0 (some minor changes/addtions to API) 2022-11-26 17:56:17 +01:00
Gene Hightower
fd622c040b Use Ragel generated RFC-5321/RFC-6531 parsrr
Mailbox address parser from <https://github.com/gene-hightower/smtp-address-validator>
2022-11-26 17:51:37 +01:00
Sam V
1063c9adba Make JSON_VALIDATOR_BUILD_EXAMPLES and JSON_VALIDATOR_BUILD_TESTS overridable by user
Resolves pboettch/json-schema-validator#195
2022-09-20 18:24:12 +02:00
res0nance
5ec1961439 cmake: add option to disable installing targets 2022-09-02 17:47:53 +02:00
vrince
b1ef862832
prepend all cmake option with JSON_VALIDATOR_ (#179)
Co-authored-by: Thomas Vincent <tvincent@ei3.com>
2021-11-19 08:55:17 +01:00
Finkman
639e09b6f9
First approach to clean out (#165)
* First approach to clean out

* Update readme remove example

* Correct readme for install and json integration
2021-11-11 20:23:50 +01:00
Mark Marshall
b10710d960 Switch on -Wshadow 2020-09-03 10:41:35 +02:00
TheMarpe
1ad9a10b0b
Fixed Hunter integration and added tests (#126) 2020-08-14 09:33:03 +02:00
Patrick Boettcher
cb5b83ebcd add simple format-callback-example
Addresses #129
2020-08-05 09:31:34 +02:00
Finkman
d3b0d327cd
re-worked install configs (#128) 2020-07-26 17:16:14 +02:00
Martin Peterlin
6e9812f4e3 Added Hunter, install and MSVC fix 2020-07-13 11:35:36 +02:00
Jakob Lykke Andersen
ef05be7efa Disable tests and examples when used via add_subdirectory. 2020-06-12 17:24:41 +02:00
Patrick Boettcher
80333cda2b bump to 2.1.1 for new developments 2020-05-23 09:04:42 +02:00
Sven Fink
cb95425f59 Add schema class that is aware of a default entry
Uses json patch format for defaults: json patch (RFC 6902) makes it
clearer in case of array contents. It is supported by nlohmann::json and
can be applied with `patch` to fill up the json with defaults.
2020-03-10 14:32:10 +01:00
Patrick Boettcher
2969393afa fix / workaround for #79 2020-02-03 10:50:56 +01:00
Lukasz Laszko
16491dfa1b example app installation added 2020-01-29 10:37:27 +01:00
Luke Kersting
8a7d1d3fde Adapt CMake project name to be coherent with nlohmann::json's naming
Now when json-schema-validator is installed CMake config files are installed in the lib/cmake/json-schema-validator directory.
The install json-schema-validatorTargets.cmake file properly imports the json-hpp and json-schema-validator libraries.
The install json-schema-validatorConfig.cmake file is used by CMake find_package function to include the json-schema-validatorTargets.cmake file and to set the variable JSON_SCHEMA_VALIDATOR_INCLUDE_DIRS to the install include directory.
To use find_package to find the json-schema-validator simply include.
A new test (test_cmake_install) has been added.

When NLohmann's JSON is install with CMake, it follows a certain
naming convention.

As we learned to do proper CMake-install thanks to @lkersting's work
this project now adapts to the way NLohmann is doing it. Namely:

- json-schema.hpp is now located (and installed)
  in a nlohmann/-subdirectory
- the CMake library and project's name is now
  nlohmann_json_schema_validator

Instead of doing non-standard acrobatics to find the json.hpp
now find_package is used in order to find NLohmann's package

Co-Authored-By: Patrick Boettcher <p@yai.se>
2019-12-05 11:12:23 +01:00
mxmlnkn
ad8f158284 add support for some built-in string format specifiers: date-time, date, time, ipv4, ipv6 2019-12-03 16:28:54 +01:00
Patrick Boettcher
d6ed73f240 Fix #53: only add -Wall/-Wextra for GCC and Clang 2019-03-20 16:58:03 +01:00
vpasacek
b01dcdb984 Install also dynamic library (dll) on windows 2019-03-20 16:53:34 +01:00
Patrick Boettcher
aa3715bdb7 Add VERSION and SOVERSION propoerty to library 2018-12-28 19:13:45 +01:00
Patrick Boettcher
efe8f7d1a4 Rename readme-target for readme-code-example 2018-12-28 11:45:02 +01:00
Adrien Martin
2c6a930341 Compile options should be private 2018-12-28 11:24:11 +01:00
Patrick Boettcher
7beb40bc61 Complete rewrite of the validator - aiming a 2.0-release
Schema a now "parsed" into C++-validator-objects in a first
step and then validation takes place with these objects.

Errors are now handled via a user-provided error-handler
allowing the user to collect all errors at once or bail out
when a certain threshold is reached. Fixes #36 and #8.

One (sub-)schema can now be referenced with different URIs. Fixes #9

JSON schema draft 7 is now supported. Fixes #35
2018-12-27 16:59:19 +01:00
Bryan Gillespie
e3d42e65c2 Add CMake options to disable extras and support install
Description:
- Adds support for the following CMake options:
- BUILD_TESTS (default: ON)
- BUILD_EXAMPLES (default: ON)
- CMAKE_INSTALL_PREFIX (both static and shared)
2018-05-12 11:22:15 +02:00
Patrick Boettcher
c552c7c02a tests: add some issue-regression-tests 2018-03-30 12:26:52 +02:00
Patrick Boettcher
2a1f77d084 cmake: allow the building of shared or static libraries
Alternative for #15
2018-02-27 11:19:06 +01:00
Patrick Boettcher
6f69d01b58 use #include <nlohmann/json.hpp> to avoid filename clashes
alternative for #20
2018-02-27 11:11:55 +01:00
Patrick Boettcher
990855cded cmake: make NLOHMANN_JSON_DIR a cache-variable for visibility 2018-01-19 09:39:33 +01:00
Patrick Boettcher
b1b5cb891c comment: fix comment regarding gcc 4.8/4.9 2018-01-19 09:39:07 +01:00
Patrick Boettcher
322d2751de cmake: better handling of how to find json.hpp 2017-08-08 15:36:59 +02:00
Gert Van Hoey
42b32c500c Build as shared library on Windows using Visual Studio compiler (#10)
* Build on Windows using Visual Studio and export symbols from DLL

* Fix two warnings on raised by Visual Studio 2015 compiler + disable -Wall and -Wextra when using Visual Studio compiler

* Fix indentation (TAB instead of spaces)
2017-08-07 13:35:35 +02:00
Antoine Havron
0de3d164d7 C++11 argument added in CmakeLists.txt 2017-04-11 08:16:30 +02:00
Patrick Boettcher
e327885992 cmake: if GCC-version is less than 4.9 print a status not a warning 2017-03-08 22:46:48 +01:00
Patrick Boettcher
dd2d95cf0a gcc-4.8: if less than 4.9 use boost::regex, if detected 2017-03-06 10:44:20 +01:00
Patrick Boettcher
3de9c6c0b7 cmake: build a shared library 2017-02-18 13:04:29 +01:00
Patrick Boettcher
a013354bc6 cmake: only install json-schema.hpp if not a subdir
(install rule needs more work, however)
2017-02-18 08:15:43 +01:00
Patrick Boettcher
93a0463bf5 tests: seperate optional and non-optional tests and define overridable name-prefix 2016-12-28 13:41:11 +01:00
Patrick Boettcher
b2240084fe validator: rework everything to handle local and remote refs
Added json-uri and json-pointer-classes and a schema-preparation-pass.
2016-12-26 23:48:57 +01:00
Patrick Boettcher
e0a69cff39 cmake: allow this project to be used as a cmake-subdirectory
Needs to have a json-hpp-target-available.
2016-12-23 09:52:17 +01:00
Patrick Boettcher
94b7e44dfa cmake: add install-target 2016-12-23 09:51:41 +01:00
Patrick Boettcher
bf4cef21c3 initial commit 2016-12-23 00:04:42 +01:00