From 4d1bc3cefeb67d1e26f05b5bf91aa559b9201759 Mon Sep 17 00:00:00 2001 From: Carsten Wickner Date: Sun, 5 Nov 2023 14:56:41 +0100 Subject: [PATCH] chore(docs): update slate-docs dependencies --- slate-docs/Gemfile | 11 +- slate-docs/Gemfile.lock | 135 +++++++++--------- .../includes/_main-generator-advanced.md | 20 +++ 3 files changed, 96 insertions(+), 70 deletions(-) diff --git a/slate-docs/Gemfile b/slate-docs/Gemfile index b2cc3659..554f508e 100644 --- a/slate-docs/Gemfile +++ b/slate-docs/Gemfile @@ -1,12 +1,13 @@ -ruby '>=2.3.1' +ruby '>= 2.6' source 'https://rubygems.org' # Middleman -gem 'middleman', '~>4.3' +gem 'middleman', '~> 4.4' gem 'middleman-syntax', '~> 3.2' -gem 'middleman-autoprefixer', '~> 2.7' +gem 'middleman-autoprefixer', '~> 3.0' gem 'middleman-sprockets', '~> 4.1' -gem 'rouge', '~> 3.20' -gem 'redcarpet', '~> 3.5.1' +gem 'rouge', '~> 3.21' +gem 'redcarpet', '~> 3.6.0' gem 'nokogiri', '~> 1.14.3' gem 'sass' +gem 'webrick' diff --git a/slate-docs/Gemfile.lock b/slate-docs/Gemfile.lock index 1da90c2b..dc02f352 100644 --- a/slate-docs/Gemfile.lock +++ b/slate-docs/Gemfile.lock @@ -1,59 +1,59 @@ GEM remote: https://rubygems.org/ specs: - activesupport (5.2.4.3) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - autoprefixer-rails (9.5.1.1) - execjs - backports (3.18.1) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + autoprefixer-rails (10.2.5.0) + execjs (< 2.8.0) + backports (3.23.0) coffee-script (2.4.1) coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.7) - contracts (0.13.0) - dotenv (2.7.6) + concurrent-ruby (1.2.2) + contracts (0.16.1) + dotenv (2.8.1) erubis (2.7.0) execjs (2.7.0) - fast_blank (1.0.0) - fastimage (2.2.0) - ffi (1.13.1) - haml (5.1.2) + fast_blank (1.0.1) + fastimage (2.2.6) + ffi (1.15.5) + haml (5.2.2) temple (>= 0.8.0) tilt hamster (3.0.0) concurrent-ruby (~> 1.0) hashie (3.6.0) - i18n (0.9.5) + i18n (1.6.0) concurrent-ruby (~> 1.0) - kramdown (2.3.1) + kramdown (2.4.0) rexml - listen (3.0.8) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) memoist (0.16.2) - middleman (4.3.8) + middleman (4.4.3) coffee-script (~> 2.2) - haml (>= 4.0.5) + haml (>= 4.0.5, < 6.0) kramdown (>= 2.3.0) - middleman-cli (= 4.3.8) - middleman-core (= 4.3.8) - middleman-autoprefixer (2.10.1) - autoprefixer-rails (~> 9.1) - middleman-core (>= 3.3.3) - middleman-cli (4.3.8) + middleman-cli (= 4.4.3) + middleman-core (= 4.4.3) + middleman-autoprefixer (3.0.0) + autoprefixer-rails (~> 10.0) + middleman-core (>= 4.0.0) + middleman-cli (4.4.3) thor (>= 0.17.0, < 2.0) - middleman-core (4.3.8) - activesupport (>= 4.2, < 6.0) - addressable (~> 2.3) + middleman-core (4.4.3) + activesupport (>= 6.1, < 7.1) + addressable (~> 2.4) backports (~> 3.6) - bundler - contracts (~> 0.13.0) + bundler (~> 2.0) + contracts (~> 0.13) dotenv erubis execjs (~> 2.0) @@ -61,43 +61,45 @@ GEM fastimage (~> 2.0) hamster (~> 3.0) hashie (~> 3.4) - i18n (~> 0.9.0) - listen (~> 3.0.0) + i18n (~> 1.6.0) + listen (~> 3.0) memoist (~> 0.14) - padrino-helpers (~> 0.13.0) + padrino-helpers (~> 0.15.0) parallel rack (>= 1.4.5, < 3) sassc (~> 2.0) servolux tilt (~> 2.0.9) + toml uglifier (~> 3.0) + webrick middleman-sprockets (4.1.1) middleman-core (~> 4.0) sprockets (>= 3.0) - middleman-syntax (3.2.0) + middleman-syntax (3.3.0) middleman-core (>= 3.2) rouge (~> 3.2) - mini_portile2 (2.8.1) - minitest (5.14.1) - nokogiri (1.14.3) + mini_portile2 (2.8.5) + minitest (5.20.0) + nokogiri (1.14.5) mini_portile2 (~> 2.8.0) racc (~> 1.4) - padrino-helpers (0.13.3.4) - i18n (~> 0.6, >= 0.6.7) - padrino-support (= 0.13.3.4) + padrino-helpers (0.15.2) + i18n (>= 0.6.7, < 2) + padrino-support (= 0.15.2) tilt (>= 1.4.1, < 3) - padrino-support (0.13.3.4) - activesupport (>= 3.1) - parallel (1.19.2) - public_suffix (4.0.6) - racc (1.6.2) - rack (2.2.6.4) - rb-fsevent (0.10.4) + padrino-support (0.15.2) + parallel (1.22.1) + parslet (2.0.0) + public_suffix (5.0.1) + racc (1.7.3) + rack (2.2.6.2) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) - redcarpet (3.5.1) + redcarpet (3.6.0) rexml (3.2.5) - rouge (3.20.0) + rouge (3.30.0) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) @@ -109,30 +111,33 @@ GEM sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) - temple (0.8.2) - thor (1.0.1) - thread_safe (0.3.6) - tilt (2.0.10) - tzinfo (1.2.10) - thread_safe (~> 0.1) + temple (0.10.0) + thor (1.2.1) + tilt (2.0.11) + toml (0.3.0) + parslet (>= 1.8.0, < 3.0.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) uglifier (3.2.0) execjs (>= 0.3.0, < 3) + webrick (1.8.1) PLATFORMS ruby DEPENDENCIES - middleman (~> 4.3) - middleman-autoprefixer (~> 2.7) + middleman (~> 4.4) + middleman-autoprefixer (~> 3.0) middleman-sprockets (~> 4.1) middleman-syntax (~> 3.2) nokogiri (~> 1.14.3) - redcarpet (~> 3.5.1) - rouge (~> 3.20) + redcarpet (~> 3.6.0) + rouge (~> 3.21) sass + webrick RUBY VERSION - ruby 2.3.3p222 + ruby 2.7.2p137 BUNDLED WITH - 2.1.4 + 2.2.22 diff --git a/slate-docs/source/includes/_main-generator-advanced.md b/slate-docs/source/includes/_main-generator-advanced.md index 6cdc215f..ecde5512 100644 --- a/slate-docs/source/includes/_main-generator-advanced.md +++ b/slate-docs/source/includes/_main-generator-advanced.md @@ -236,3 +236,23 @@ When not even the [Custom Type Definitions](#custom-type-definitions) are flexib However, you can still decide whether the attributes collected through the various other Individual Configurations shall be added, through the AttributeInclusion parameter in the CustomPropertyDefinition's constructor. + +## Order of Object Properties +```java +// sort by custom @JsonPropertyIndex(3) annotation +configBuilder.forTypesInGeneral() + .withPropertySorter(Comparator.comparing(member -> Optional.ofNullable(member.getAnnotation(JsonPropertyIndex.class)) + .map(JsonPropertyIndex::value) + .orElse(0))); +``` +```java +// preserve property order in byte code (determined by compiler) +configBuilder.forTypesInGeneral() + .withPropertySorter((first, second) -> 0); +``` + +You may want to control the order in which an object's properties are being listed, e.g., when using the JSON schema as basis for an auto-generated form in some user interface. +By default, fields are being included before methods -- with each sublist being sorted alphabetically. + +You can define your own `Comparator>`, e.g., considering an annotation specifying the desired order or disable the sorting by always returning zero (`0`). +With disabled property sorting, your compiler decides the order of the properties in your generated JSON schema. Depending on the compiler, this may correspond to the declaration order in your source file but is not guaranteed.