diff --git a/compiler-rs/Cargo.lock b/compiler-rs/Cargo.lock index 9ca0a2f0eb..8b0cbd1449 100644 --- a/compiler-rs/Cargo.lock +++ b/compiler-rs/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aho-corasick" @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" dependencies = [ "anstyle", "anstyle-parse", @@ -43,36 +43,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" dependencies = [ "anstyle", - "once_cell", + "once_cell_polyfill", "windows-sys 0.59.0", ] @@ -131,9 +131,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", "cfg-if", @@ -146,15 +146,15 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" [[package]] name = "bytes" @@ -164,24 +164,24 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.20" +version = "1.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" +checksum = "d487aa071b5f64da6f19a3e848e3578944b726ee5a4854b82172f02aa876bfdc" dependencies = [ "shlex", ] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "clap" -version = "4.5.37" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ "clap_builder", "clap_derive", @@ -189,9 +189,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.37" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ "anstream", "anstyle", @@ -201,9 +201,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.32" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" dependencies = [ "heck", "proc-macro2", @@ -213,9 +213,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "clients_schema" @@ -254,9 +254,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "compiler-wasm-lib" @@ -274,6 +274,18 @@ dependencies = [ "wasm-bindgen-test", ] +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "windows-sys 0.59.0", +] + [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -390,6 +402,12 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + [[package]] name = "env_filter" version = "0.1.3" @@ -433,14 +451,14 @@ checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", @@ -456,9 +474,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "heck" @@ -573,6 +591,18 @@ dependencies = [ "serde", ] +[[package]] +name = "insta" +version = "1.43.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "154934ea70c58054b556dd430b99a98c2a7ff5309ac9891597e339b5c28f4371" +dependencies = [ + "console", + "once_cell", + "serde", + "similar", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -596,9 +626,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a064218214dc6a10fbae5ec5fa888d80c45d611aba169222fc272072bf7aef6" +checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" dependencies = [ "jiff-static", "log", @@ -609,9 +639,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199b7932d97e325aff3a7030e141eafe7f2c6268e1d1b24859b753a627f45254" +checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" dependencies = [ "proc-macro2", "quote", @@ -636,15 +666,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.172" +version = "0.2.173" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" +checksum = "d8cfeafaffdbc32176b64fb251369d52ea9f0a8fbc6f8759edffef7b525d64bb" [[package]] name = "libm" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9627da5196e5d8ed0b0495e61e518847578da83483c37288316d9b2e03a7f72" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libyml" @@ -660,9 +690,9 @@ checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -682,9 +712,9 @@ checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "minicov" @@ -698,22 +728,22 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] @@ -747,6 +777,12 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + [[package]] name = "openapi_to_clients_schema" version = "0.1.0" @@ -755,6 +791,7 @@ dependencies = [ "clients_schema", "convert_case", "indexmap", + "insta", "openapiv3", "serde_ignored", "serde_json", @@ -765,9 +802,9 @@ dependencies = [ [[package]] name = "openapiv3" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc02deea53ffe807708244e5914f6b099ad7015a207ee24317c22112e17d9c5c" +checksum = "5c8d427828b22ae1fff2833a03d8486c2c881367f1c336349f307f321e7f4d05" dependencies = [ "indexmap", "serde", @@ -782,9 +819,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -792,9 +829,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", @@ -811,9 +848,9 @@ checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "portable-atomic" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "portable-atomic-util" @@ -895,9 +932,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.11" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ "bitflags", ] @@ -967,15 +1004,15 @@ checksum = "a157657054ffe556d8858504af8a672a054a6e0bd9e8ee531059100c0fa11bb2" [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" [[package]] name = "rustversion" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" @@ -1029,9 +1066,9 @@ dependencies = [ [[package]] name = "serde_ignored" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566da67d80e92e009728b3731ff0e5360cb181432b8ca73ea30bb1d170700d76" +checksum = "b516445dac1e3535b6d658a7b528d771153dfb272ed4180ca4617a20550365ff" dependencies = [ "serde", ] @@ -1101,17 +1138,23 @@ dependencies = [ "libc", ] +[[package]] +name = "similar" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" + [[package]] name = "smallvec" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1131,9 +1174,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.100" +version = "2.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" dependencies = [ "proc-macro2", "quote", @@ -1142,9 +1185,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -1159,12 +1202,11 @@ checksum = "614b328ff036a4ef882c61570f72918f7e9c5bee1da33f8e7f91e01daee7e56c" [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -1197,9 +1239,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.44.2" +version = "1.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "bytes", @@ -1237,9 +1279,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", @@ -1248,9 +1290,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -1318,11 +1360,13 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" dependencies = [ - "getrandom 0.3.2", + "getrandom 0.3.3", + "js-sys", + "wasm-bindgen", ] [[package]] @@ -1376,9 +1420,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -1527,9 +1571,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-link" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-sys" diff --git a/compiler-rs/openapi_to_clients_schema/Cargo.toml b/compiler-rs/openapi_to_clients_schema/Cargo.toml index 4ecbaa258f..e2dd896c38 100644 --- a/compiler-rs/openapi_to_clients_schema/Cargo.toml +++ b/compiler-rs/openapi_to_clients_schema/Cargo.toml @@ -20,6 +20,13 @@ convert_case = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } +[dev-dependencies] +insta = { version = "1.41.1", features = ["json", "serde"] } + +[profile.dev.package] +insta.opt-level = 3 +similar.opt-level = 3 + # Some json schema implementations #boon = "0.3.1" #jsonschema-transpiler = "1.10.0" diff --git a/compiler-rs/openapi_to_clients_schema/fixtures/kibana.serverless.yaml b/compiler-rs/openapi_to_clients_schema/fixtures/kibana.serverless.yaml new file mode 100644 index 0000000000..8a64750c73 --- /dev/null +++ b/compiler-rs/openapi_to_clients_schema/fixtures/kibana.serverless.yaml @@ -0,0 +1,319 @@ +openapi: 3.0.3 +info: + contact: + name: Kibana Team + description: | + The Kibana REST APIs for Elastic serverless enable you to manage resources + such as connectors, data views, and saved objects. The API calls are + stateless. Each request that you make happens in isolation from other calls + and must include all of the necessary information for Kibana to fulfill the + request. API requests return JSON output, which is a format that is + machine-readable and works well for automation. + + To interact with Kibana APIs, use the following operations: + + - GET: Fetches the information. + - POST: Adds new information. + - PUT: Updates the existing information. + - DELETE: Removes the information. + + You can prepend any Kibana API endpoint with `kbn:` and run the request in + **Dev Tools → Console**. For example: + + ``` + GET kbn:/api/data_views + ``` + + ## Documentation source and versions + + This documentation is derived from the `main` branch of the [kibana](https://github.com/elastic/kibana) repository. + It is provided under license [Attribution-NonCommercial-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nc-nd/4.0/). + title: Kibana Serverless APIs + version: 1.0.2 + x-doc-license: + name: Attribution-NonCommercial-NoDerivatives 4.0 International + url: https://creativecommons.org/licenses/by-nc-nd/4.0/ + x-feedbackLink: + label: Feedback + url: https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+ +servers: + - url: https://{kibana_url} + variables: + kibana_url: + default: localhost:5601 +paths: + /api/status: + get: + operationId: SystemStatus + parameters: + - description: The version of the API to use + in: header + name: elastic-api-version + schema: + default: '2023-10-31' + enum: + - '2023-10-31' + type: string + - description: Set to "true" to get the response in v7 format. + in: query + name: v7format + required: false + schema: + type: boolean + - description: Set to "true" to get the response in v8 format. + in: query + name: v8format + required: false + schema: + type: boolean + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Kibana_HTTP_APIs_core_status_response' + description: Overall status is OK and Kibana should be functioning normally. + summary: Get Kibana's current status + tags: + - system +components: + schemas: + Kibana_HTTP_APIs_core_status_redactedResponse: + additionalProperties: false + description: A minimal representation of Kibana's operational status. + properties: + status: + additionalProperties: false + properties: + overall: + additionalProperties: false + properties: + level: + description: + Service status levels as human and machine readable + values. + enum: [available, degraded, unavailable, critical] + type: string + required: [level] + type: object + required: [overall] + type: object + required: [status] + type: object + Kibana_HTTP_APIs_core_status_response: + additionalProperties: false + description: Kibana's operational status as well as a detailed breakdown of plugin statuses indication of various loads (like event loop utilization and network traffic) at time of request. + type: object + properties: + metrics: + additionalProperties: false + description: Metric groups collected by Kibana. + type: object + properties: + collection_interval_in_millis: + description: The interval at which metrics should be collected. + type: number + elasticsearch_client: + additionalProperties: false + description: Current network metrics of Kibana's Elasticsearch client. + type: object + properties: + totalActiveSockets: + description: Count of network sockets currently in use. + type: number + totalIdleSockets: + description: Count of network sockets currently idle. + type: number + totalQueuedRequests: + description: Count of requests not yet assigned to sockets. + type: number + required: + - totalActiveSockets + - totalIdleSockets + - totalQueuedRequests + last_updated: + description: The time metrics were collected. + type: string + required: + - elasticsearch_client + - last_updated + - collection_interval_in_millis + name: + description: Kibana instance name. + type: string + status: + additionalProperties: false + type: object + properties: + core: + additionalProperties: false + description: Statuses of core Kibana services. + type: object + properties: + elasticsearch: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: Service status levels as human and machine readable values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: true + description: An unstructured set of extra metadata about this service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + savedObjects: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: Service status levels as human and machine readable values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: true + description: An unstructured set of extra metadata about this service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + required: + - elasticsearch + - savedObjects + overall: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: Service status levels as human and machine readable values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: true + description: An unstructured set of extra metadata about this service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + plugins: + additionalProperties: + additionalProperties: false + type: object + properties: + detail: + description: Human readable detail of the service status. + type: string + documentationUrl: + description: A URL to further documentation regarding this service. + type: string + level: + description: Service status levels as human and machine readable values. + enum: + - available + - degraded + - unavailable + - critical + type: string + meta: + additionalProperties: true + description: An unstructured set of extra metadata about this service. + type: object + summary: + description: A human readable summary of the service status. + type: string + required: + - level + - summary + - meta + description: A dynamic mapping of plugin ID to plugin status. + type: object + required: + - overall + - core + - plugins + uuid: + description: Unique, generated Kibana instance UUID. This UUID should persist even if the Kibana process restarts. + type: string + version: + additionalProperties: false + type: object + properties: + build_date: + description: The date and time of this build. + type: string + build_flavor: + description: The build flavour determines configuration and behavior of Kibana. On premise users will almost always run the "traditional" flavour, while other flavours are reserved for Elastic-specific use cases. + enum: + - serverless + - traditional + type: string + build_hash: + description: A unique hash value representing the git commit of this Kibana build. + type: string + build_number: + description: A monotonically increasing number, each subsequent build will have a higher number. + type: number + build_snapshot: + description: Whether this build is a snapshot build. + type: boolean + number: + description: A semantic version number. + type: string + required: + - number + - build_hash + - build_number + - build_snapshot + - build_flavor + - build_date + required: + - name + - uuid + - version + - status + - metrics diff --git a/compiler-rs/openapi_to_clients_schema/src/endpoints.rs b/compiler-rs/openapi_to_clients_schema/src/endpoints.rs index 468c24678e..6d07c11853 100644 --- a/compiler-rs/openapi_to_clients_schema/src/endpoints.rs +++ b/compiler-rs/openapi_to_clients_schema/src/endpoints.rs @@ -15,4 +15,173 @@ // specific language governing permissions and limitations // under the License. -// TODO +use clients_schema::{ + builtins, BaseType, Body, Endpoint, InstanceOf, NoBody, Property, Request, TypeDefinition, TypeName, UrlTemplate, + ValueOf, +}; +use openapiv3::{ReferenceOr, StatusCode}; + +use crate::types::{self, Types}; +use tracing::info; + +pub fn generate_endpoint( + id: &str, + path: &openapiv3::ReferenceOr, + types: &mut Types, +) -> anyhow::Result { + info!("Generating endpoint for {id}"); + match path { + ReferenceOr::Item(path_item) => { + if let Some(operation) = &path_item.get { + generate_get_endpoint(id, &operation, types) + } else { + Err(anyhow::anyhow!("No get operation found for endpoint {}", id)) + } + } + _ => Err(anyhow::anyhow!("No description found for endpoint {}", id)), + } +} + +fn generate_get_endpoint(id: &str, operation: &openapiv3::Operation, types: &mut Types) -> anyhow::Result { + use convert_case::{Case, Casing}; + + let default_name = operation.operation_id.as_deref().unwrap_or_default(); + let name = format!("_global.{}", default_name.to_case(Case::Snake)); + let description = operation.summary.as_deref().unwrap_or_default().to_string(); + + let response = generate_get_response(&operation); + let response_media_type = if response.is_some() { + vec!["application/json".to_string()] + } else { + vec![] + }; + let request = generate_get_request(&operation, types)?; + let urls = vec![UrlTemplate { + path: id.to_string(), + methods: vec!["GET".to_string()], + deprecation: None, + }]; + + Ok(Endpoint { + name, + description, + doc_url: None, + doc_id: None, + ext_doc_id: None, + ext_doc_url: None, + deprecation: None, + availability: None, + doc_tag: None, + request: Some(request), + request_body_required: false, + response, + urls, + request_media_type: vec![], + response_media_type, + privileges: None, + }) +} + +fn generate_get_response(operation: &openapiv3::Operation) -> Option { + let openapi_response: &ReferenceOr = + operation.responses.responses.get(&StatusCode::Code(200))?; + let response_typename = match openapi_response { + ReferenceOr::Reference { reference } => types::ref_to_typename(reference), + ReferenceOr::Item(response) => match response.content.values().next()?.schema.as_ref()? { + ReferenceOr::Reference { reference } => types::ref_to_typename(reference), + ReferenceOr::Item(schema) => panic!("complex schema not expected {:?}", schema.schema_kind), + }, + }; + Some(response_typename) +} + +fn generate_get_request(operation: &openapiv3::Operation, types: &mut Types) -> anyhow::Result { + let mut query = vec![]; + for parameter in &operation.parameters { + match parameter { + ReferenceOr::Reference { .. } => panic!("expected parameter to be inlined"), + ReferenceOr::Item(parameter) => { + match ¶meter { + openapiv3::Parameter::Query { parameter_data, .. } => { + let type_ = match ¶meter_data.format { + openapiv3::ParameterSchemaOrContent::Schema(ref_or_schema) => match ref_or_schema { + ReferenceOr::Item(item) => match &item.schema_kind { + openapiv3::SchemaKind::Type(type_) => convert_builtin_type(type_)?, + _ => return Err(anyhow::anyhow!("unexpected schema kind")), + }, + ReferenceOr::Reference { reference } => { + return Err(anyhow::anyhow!("unexpected ReferenceOr::Reference({})", reference)) + } + }, + openapiv3::ParameterSchemaOrContent::Content(content) => { + return Err(anyhow::anyhow!("unexpected Content({:?})", content)) + } + }; + + query.push(Property { + name: parameter_data.name.clone(), + typ: ValueOf::InstanceOf(InstanceOf::new(type_)), + description: parameter_data.description.clone(), + required: parameter_data.required, + doc_url: None, + doc_id: None, + ext_doc_url: None, + ext_doc_id: None, + server_default: None, + deprecation: None, + availability: None, + codegen_name: None, + aliases: vec![], + container_property: false, + es_quirk: None, + }); + } + _ => (), + }; + } + } + } + let request = Request { + base: BaseType { + name: TypeName { + namespace: "_global".into(), + name: "SystemStatusRequest".into(), + }, + description: None, + doc_url: None, + doc_id: None, + ext_doc_url: None, + ext_doc_id: None, + deprecation: None, + es_quirk: None, + variant_name: None, + codegen_names: vec![], + spec_location: None, + }, + generics: vec![], + inherits: None, + implements: vec![], + path: vec![], + query, + body: Body::NoBody(NoBody {}), + behaviors: vec![], + attached_behaviors: vec![], + }; + types.add("SystemStatusRequest", TypeDefinition::Request(request.clone())); + Ok(request.base.name.clone()) +} + +fn convert_builtin_type(type_: &openapiv3::Type) -> anyhow::Result { + Ok(match type_ { + openapiv3::Type::Boolean(_) => builtins::BOOLEAN.clone(), + openapiv3::Type::Integer(_) => builtins::INTEGER.clone(), + openapiv3::Type::Number(variant) => match &variant.format { + openapiv3::VariantOrUnknownOrEmpty::Item(number_type) => match number_type { + openapiv3::NumberFormat::Float => builtins::FLOAT.clone(), + openapiv3::NumberFormat::Double => builtins::DOUBLE.clone(), + }, + _ => builtins::DOUBLE.clone(), + }, + _ => return Err(anyhow::anyhow!("unexpected type {:?}", type_)), + }) +} diff --git a/compiler-rs/openapi_to_clients_schema/src/lib.rs b/compiler-rs/openapi_to_clients_schema/src/lib.rs index ca763ab2cc..2c4dfd0c7c 100644 --- a/compiler-rs/openapi_to_clients_schema/src/lib.rs +++ b/compiler-rs/openapi_to_clients_schema/src/lib.rs @@ -21,27 +21,30 @@ pub mod types; use std::convert::Into; +use anyhow::Error; use clients_schema::IndexedModel; use openapi::OpenAPI; use tracing::warn; +use types::Types; /// Generate a schema.json from an OpenAPI schema pub fn generate(open_api: &OpenAPI) -> anyhow::Result { let mut json_schema = clients_schema::IndexedModel::default(); - generate_types(open_api, &mut json_schema)?; + let mut schema_types = generate_types(open_api)?; + generate_endpoints(open_api, &mut json_schema, &mut schema_types)?; - // endpoints - // for (id, path) in &open_api.paths.paths { - // let endpoint = generate_endpoint(open_api, id, path)?; - // json_schema.endpoints.push(endpoint); - // } + json_schema.types = schema_types + .types() + .into_iter() + .map(|t| (t.name().clone(), t)) + .collect(); Ok(json_schema) } /// Generate all types from OpenAPI components -fn generate_types(open_api: &OpenAPI, model: &mut IndexedModel) -> anyhow::Result<()> { +fn generate_types(open_api: &OpenAPI) -> anyhow::Result { if let Some(ref components) = open_api.components { let mut types = types::Types::default(); for (id, schema) in &components.schemas { @@ -52,7 +55,16 @@ fn generate_types(open_api: &OpenAPI, model: &mut IndexedModel) -> anyhow::Resul } } let _ = types.check_tracker(); // TODO: actually fail - model.types = types.types().into_iter().map(|t| (t.name().clone(), t)).collect(); + Ok(types) + } else { + Err(Error::msg("No components found")) + } +} + +fn generate_endpoints(open_api: &OpenAPI, json_schema: &mut IndexedModel, types: &mut Types) -> anyhow::Result<()> { + for (id, path) in &open_api.paths.paths { + let endpoint = endpoints::generate_endpoint(id, path, types)?; + json_schema.endpoints.push(endpoint); } Ok(()) diff --git a/compiler-rs/openapi_to_clients_schema/src/main.rs b/compiler-rs/openapi_to_clients_schema/src/main.rs index 1f7c2be6d7..2b0fc349fe 100644 --- a/compiler-rs/openapi_to_clients_schema/src/main.rs +++ b/compiler-rs/openapi_to_clients_schema/src/main.rs @@ -34,6 +34,17 @@ fn main() -> anyhow::Result<()> { _ => return Err(anyhow::anyhow!("expected a single argument")), }; + let open_api = read_openapi_schema(path)?; + let sch_json = openapi_to_clients_schema::generate(&OpenAPI(open_api))?; + + let dest = PathBuf::from(path).with_extension("schema.json"); + let output = std::fs::File::create(dest)?; + serde_json::to_writer_pretty(output, &sch_json)?; + + Ok(()) +} + +fn read_openapi_schema(path: &str) -> anyhow::Result { info!("Loading OpenAPI from {path}"); let data = std::fs::read_to_string(path)?; @@ -46,27 +57,30 @@ fn main() -> anyhow::Result<()> { serde_ignored::deserialize(&mut deser, |path| { unused.insert(path.to_string()); }) - .map_err(From::from) + .map_err(Into::into) } Some(ext) if ext == "yml" || ext == "yaml" => { let deser = serde_yml::Deserializer::from_str(&data); serde_ignored::deserialize(deser, |path| { unused.insert(path.to_string()); }) - .map_err(From::from) + .map_err(Into::into) } _ => Err(anyhow::anyhow!(format!("Unsupported file extension {:?}", path))), - }?; + }; if !unused.is_empty() { - println!("Unused fields in the OpenAPI schema: {:?}", unused); + let message = format!("Unused fields in the OpenAPI schema: {:?}", unused); + return Err(anyhow::anyhow!(message)); } - let sch_json = openapi_to_clients_schema::generate(&OpenAPI(open_api))?; - - let dest = PathBuf::from(path).with_extension("schema.json"); - let output = std::fs::File::create(dest)?; - serde_json::to_writer_pretty(output, &sch_json)?; + open_api +} +#[test] +fn test_kibana_conversion() -> anyhow::Result<()> { + let open_api = read_openapi_schema("fixtures/kibana.serverless.yaml")?; + let sch_json = openapi_to_clients_schema::generate(&OpenAPI(open_api))?; + insta::assert_json_snapshot!(sch_json); Ok(()) } diff --git a/compiler-rs/openapi_to_clients_schema/src/snapshots/openapi_to_clients_schema__kibana_conversion.snap b/compiler-rs/openapi_to_clients_schema/src/snapshots/openapi_to_clients_schema__kibana_conversion.snap new file mode 100644 index 0000000000..162b51ddaf --- /dev/null +++ b/compiler-rs/openapi_to_clients_schema/src/snapshots/openapi_to_clients_schema__kibana_conversion.snap @@ -0,0 +1,1197 @@ +--- +source: openapi_to_clients_schema/src/main.rs +expression: sch_json +--- +{ + "endpoints": [ + { + "name": "_global.system_status", + "description": "Get Kibana's current status", + "request": { + "namespace": "_global", + "name": "SystemStatusRequest" + }, + "requestBodyRequired": false, + "response": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponse" + }, + "urls": [ + { + "path": "/api/status", + "methods": [ + "GET" + ] + } + ], + "responseMediaType": [ + "application/json" + ] + } + ], + "types": [ + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusRedactedResponse" + }, + "description": "A minimal representation of Kibana's operational status.", + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "status", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusRedactedResponseStatus" + } + }, + "required": true + } + ] + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusRedactedResponseStatus" + }, + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "overall", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusRedactedResponseStatusOverall" + } + }, + "required": true + } + ] + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusRedactedResponseStatusOverall" + }, + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "level", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusRedactedResponseStatusOverallLevel" + } + }, + "required": true + } + ] + }, + { + "kind": "enum", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusRedactedResponseStatusOverallLevel" + }, + "description": "Service status levels as human and machine readable values.", + "isOpen": false, + "members": [ + { + "name": "available" + }, + { + "name": "degraded" + }, + { + "name": "unavailable" + }, + { + "name": "critical" + } + ] + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponse" + }, + "description": "Kibana's operational status as well as a detailed breakdown of plugin statuses indication of various loads (like event loop utilization and network traffic) at time of request.", + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "metrics", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseMetrics" + } + }, + "required": true + }, + { + "name": "name", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": true + }, + { + "name": "status", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatus" + } + }, + "required": true + }, + { + "name": "uuid", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": true + }, + { + "name": "version", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseVersion" + } + }, + "required": true + } + ] + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseMetrics" + }, + "description": "Metric groups collected by Kibana.", + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "collection_interval_in_millis", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "double" + } + }, + "required": true + }, + { + "name": "elasticsearch_client", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseMetricsElasticsearchClient" + } + }, + "required": true + }, + { + "name": "last_updated", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": true + } + ] + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseMetricsElasticsearchClient" + }, + "description": "Current network metrics of Kibana's Elasticsearch client.", + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "totalActiveSockets", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "double" + } + }, + "required": true + }, + { + "name": "totalIdleSockets", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "double" + } + }, + "required": true + }, + { + "name": "totalQueuedRequests", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "double" + } + }, + "required": true + } + ] + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatus" + }, + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "core", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCore" + } + }, + "required": true + }, + { + "name": "overall", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusOverall" + } + }, + "required": true + }, + { + "name": "plugins", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusPlugins" + } + }, + "required": true + } + ] + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCore" + }, + "description": "Statuses of core Kibana services.", + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "elasticsearch", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreElasticsearch" + } + }, + "required": true + }, + { + "name": "savedObjects", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreSavedObjects" + } + }, + "required": true + } + ] + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreElasticsearch" + }, + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "detail", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": false + }, + { + "name": "documentationUrl", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": false + }, + { + "name": "level", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreElasticsearchLevel" + } + }, + "required": true + }, + { + "name": "meta", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreElasticsearchMeta" + } + }, + "required": true + }, + { + "name": "summary", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": true + } + ] + }, + { + "kind": "enum", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreElasticsearchLevel" + }, + "description": "Service status levels as human and machine readable values.", + "isOpen": false, + "members": [ + { + "name": "available" + }, + { + "name": "degraded" + }, + { + "name": "unavailable" + }, + { + "name": "critical" + } + ] + }, + { + "kind": "type_alias", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreElasticsearchMeta" + }, + "description": "An unstructured set of extra metadata about this service.", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "Dictionary" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreSavedObjects" + }, + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "detail", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": false + }, + { + "name": "documentationUrl", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": false + }, + { + "name": "level", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreSavedObjectsLevel" + } + }, + "required": true + }, + { + "name": "meta", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreSavedObjectsMeta" + } + }, + "required": true + }, + { + "name": "summary", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": true + } + ] + }, + { + "kind": "enum", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreSavedObjectsLevel" + }, + "description": "Service status levels as human and machine readable values.", + "isOpen": false, + "members": [ + { + "name": "available" + }, + { + "name": "degraded" + }, + { + "name": "unavailable" + }, + { + "name": "critical" + } + ] + }, + { + "kind": "type_alias", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusCoreSavedObjectsMeta" + }, + "description": "An unstructured set of extra metadata about this service.", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "Dictionary" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusOverall" + }, + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "detail", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": false + }, + { + "name": "documentationUrl", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": false + }, + { + "name": "level", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusOverallLevel" + } + }, + "required": true + }, + { + "name": "meta", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusOverallMeta" + } + }, + "required": true + }, + { + "name": "summary", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": true + } + ] + }, + { + "kind": "enum", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusOverallLevel" + }, + "description": "Service status levels as human and machine readable values.", + "isOpen": false, + "members": [ + { + "name": "available" + }, + { + "name": "degraded" + }, + { + "name": "unavailable" + }, + { + "name": "critical" + } + ] + }, + { + "kind": "type_alias", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusOverallMeta" + }, + "description": "An unstructured set of extra metadata about this service.", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "Dictionary" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + }, + { + "kind": "type_alias", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusPlugins" + }, + "description": "A dynamic mapping of plugin ID to plugin status.", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "Dictionary" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusPluginsValue" + } + } + ] + } + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusPluginsValue" + }, + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "detail", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": false + }, + { + "name": "documentationUrl", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": false + }, + { + "name": "level", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusPluginsValueLevel" + } + }, + "required": true + }, + { + "name": "meta", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusPluginsValueMeta" + } + }, + "required": true + }, + { + "name": "summary", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": true + } + ] + }, + { + "kind": "enum", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusPluginsValueLevel" + }, + "description": "Service status levels as human and machine readable values.", + "isOpen": false, + "members": [ + { + "name": "available" + }, + { + "name": "degraded" + }, + { + "name": "unavailable" + }, + { + "name": "critical" + } + ] + }, + { + "kind": "type_alias", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseStatusPluginsValueMeta" + }, + "description": "An unstructured set of extra metadata about this service.", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "Dictionary" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + }, + { + "kind": "interface", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseVersion" + }, + "behaviors": [ + { + "type": { + "namespace": "_spec_utils", + "name": "AdditionalProperties" + }, + "generics": [ + { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "UserDefined" + } + } + ] + } + ], + "properties": [ + { + "name": "build_date", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": true + }, + { + "name": "build_flavor", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseVersionBuildFlavor" + } + }, + "required": true + }, + { + "name": "build_hash", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": true + }, + { + "name": "build_number", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "double" + } + }, + "required": true + }, + { + "name": "build_snapshot", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "boolean" + } + }, + "required": true + }, + { + "name": "number", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "string" + } + }, + "required": true + } + ] + }, + { + "kind": "enum", + "name": { + "namespace": "_global", + "name": "KibanaHttpApIsCoreStatusResponseVersionBuildFlavor" + }, + "description": "The build flavour determines configuration and behavior of Kibana. On premise users will almost always run the \"traditional\" flavour, while other flavours are reserved for Elastic-specific use cases.", + "isOpen": false, + "members": [ + { + "name": "serverless" + }, + { + "name": "traditional" + } + ] + }, + { + "kind": "request", + "name": { + "namespace": "_global", + "name": "SystemStatusRequest" + }, + "inherits": null, + "path": [], + "query": [ + { + "name": "v7format", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "boolean" + } + }, + "required": false, + "description": "Set to \"true\" to get the response in v7 format." + }, + { + "name": "v8format", + "type": { + "kind": "instance_of", + "type": { + "namespace": "_builtins", + "name": "boolean" + } + }, + "required": false, + "description": "Set to \"true\" to get the response in v8 format." + } + ], + "body": { + "kind": "no_body" + } + } + ] +} diff --git a/compiler-rs/openapi_to_clients_schema/src/types.rs b/compiler-rs/openapi_to_clients_schema/src/types.rs index 6d341465b3..d079626c94 100644 --- a/compiler-rs/openapi_to_clients_schema/src/types.rs +++ b/compiler-rs/openapi_to_clients_schema/src/types.rs @@ -55,7 +55,7 @@ impl Types { let mut failed = false; for id in self.tracker.iter() { if !self.types.contains_key(id) { - error!("Type '{id}' tracked but but not generated."); + error!("Type '{id}' tracked but not generated."); failed = true; } } @@ -532,7 +532,7 @@ fn id_to_typename(id: &str) -> TypeName { } } -fn ref_to_typename(ref_id: &str) -> TypeName { +pub fn ref_to_typename(ref_id: &str) -> TypeName { let id = ref_id.trim_start_matches("#/components/schemas/"); id_to_typename(id) }