Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
5aea973
[compiler] Include exceptions to schema (#4695) (#4699)
github-actions[bot] Jun 27, 2025
b7637b5
Update rest-api-spec (#4704)
github-actions[bot] Jun 30, 2025
4536b72
Add missing annotation to name the addition properties field (#4708) …
github-actions[bot] Jun 30, 2025
355bbbc
Fixing indices create partially (#4652) (#4716)
github-actions[bot] Jun 30, 2025
7bce598
Fixing nodes info response (#4636) (#4720)
github-actions[bot] Jun 30, 2025
a1fcb39
[DOCS] Change source for overlay-docs (#4504) (#4724)
github-actions[bot] Jun 30, 2025
a482034
add branch option to cli (#4722) (#4735)
github-actions[bot] Jul 1, 2025
abab269
regen compiler rs
l-trotta Jul 1, 2025
e511663
Update rest-api-spec (#4730)
github-actions[bot] Jul 1, 2025
3f9156b
Add new search load metrics to SearchStats (#4731) (#4740)
github-actions[bot] Jul 1, 2025
34355a5
Add rerank task type specification (#4488) (#4742)
github-actions[bot] Jul 1, 2025
7c363b9
Adds cat node -h enumerated values (#4736) (#4747)
github-actions[bot] Jul 1, 2025
31c9e34
[ML] Add DeepSeek (#4723) (#4748)
github-actions[bot] Jul 1, 2025
a02de6b
Update rest-api-spec (#4753)
github-actions[bot] Jul 2, 2025
2cbbf30
Adds external link to 'Update a document API' (#4657) (#4758)
github-actions[bot] Jul 2, 2025
4bf9396
Adds external link to the Synonyms API (#4756) (#4769)
github-actions[bot] Jul 3, 2025
a4087bf
Adds external link to Rollup search API (#4673) (#4767)
kosabogi Jul 3, 2025
7dd9179
Add link to `_update_by_query` API examples (#4705) (#4773)
github-actions[bot] Jul 4, 2025
3d9fe29
Adds cat node -h values (#4771) (#4779)
github-actions[bot] Jul 4, 2025
0217fff
Add index block removal API (#4684) (#4780)
github-actions[bot] Jul 4, 2025
dbffd2b
add server default values to properties in generated OpenAPI (#4774) …
github-actions[bot] Jul 4, 2025
301a7af
add a description field for external doc links (#4772) (#4787)
github-actions[bot] Jul 4, 2025
bc18fc0
Add Sparse Vector Index Options for Token Pruning to Specification (#…
markjhoy Jul 4, 2025
4e6a141
Output validation comments even without changes (#4781) (#4799)
github-actions[bot] Jul 7, 2025
67a13ec
Add require_data_stream query parameter to index (#4803) (#4806)
github-actions[bot] Jul 7, 2025
ffc2dfc
Fix type query paramter in license.post_start_trial (#4807) (#4810)
github-actions[bot] Jul 7, 2025
0c6fb57
Remove master_timeout from ingest.get_ip_location_database (#4804) (#…
github-actions[bot] Jul 7, 2025
7dc5a58
Add missing cause to cluster.put_component_template (#4795) (#4818)
pquentin Jul 7, 2025
871c78a
Remove unsupported stored_fields from get_source API (#4786) (#4822)
pquentin Jul 7, 2025
576fc37
Add missing create index response example (#4701) (#4829)
github-actions[bot] Jul 7, 2025
9d82ca5
Fix reranking typo (#4832) (#4836)
github-actions[bot] Jul 8, 2025
e1094a2
Update rest-api-spec 9.1 (#4765)
github-actions[bot] Jul 8, 2025
34baacc
Adds missing required cluster privilege information (#4797) (#4840)
github-actions[bot] Jul 9, 2025
00ee02a
Update rest-api-spec (#4845)
github-actions[bot] Jul 9, 2025
7ad01b3
Allow containers with a single variant (#4853) (#4857)
github-actions[bot] Jul 10, 2025
8119be2
Adds input_type parameter to POST inference docs at the root level (#…
github-actions[bot] Jul 10, 2025
9c9d948
change product feature output (#4860) (#4862)
l-trotta Jul 10, 2025
fd4db4f
Add max_docs query parameter to reindex API (#4842) (#4866)
github-actions[bot] Jul 11, 2025
97f3672
Add track_total_hits to search_mvt (#4850) (#4871)
github-actions[bot] Jul 11, 2025
86478d0
Add wait_for_completion to snapshot.delete (#4875) (#4877)
github-actions[bot] Jul 11, 2025
de0746d
Remove query parameters from security.get_user_privileges (#4869) (#4…
github-actions[bot] Jul 11, 2025
60fd208
Add refresh to security.grant_api_key (#4872) (#4889)
github-actions[bot] Jul 11, 2025
717c42a
Update rest-api-spec (#4854)
github-actions[bot] Jul 14, 2025
fa191f4
upgrade the request converter to apply a bug fix (#4892) (#4897)
github-actions[bot] Jul 14, 2025
eba7329
Fixed a badly formatted example (#4851) (#4904)
github-actions[bot] Jul 14, 2025
7461ec0
fix availability params (#4905) (#4907)
l-trotta Jul 14, 2025
5e29007
Update specification output
l-trotta Jul 14, 2025
bee9d90
Re-add API example files (#4670) (#4916)
github-actions[bot] Jul 15, 2025
63fd76b
Restore Watcher execute watch request examples (#4754) (#4917)
github-actions[bot] Jul 15, 2025
c2aa0f7
move language examples to a separate file (#4910) (#4919)
pquentin Jul 15, 2025
2f55ede
Updated ES specification to support simplified retrievers (#4912) (#4…
github-actions[bot] Jul 15, 2025
a165149
Add timeout params for PUT inference and POST inference/_stream (#489…
github-actions[bot] Jul 15, 2025
30c43f9
Update rest-api-spec 9.1 (#4930)
github-actions[bot] Jul 15, 2025
119eb27
Update rest-api-spec (#4937)
github-actions[bot] Jul 16, 2025
50712d7
Ignore human overloading error in xpack.info request (#4944) (#4948)
github-actions[bot] Jul 17, 2025
e0e4bca
Fixing cluster stats response (#4632) (#4952)
github-actions[bot] Jul 17, 2025
f914a7d
Update rest-api-spec (#4959)
github-actions[bot] Jul 18, 2025
6e01577
Add missing indices options to index recovery API (#4954) (#4960)
pquentin Jul 18, 2025
01fd420
typo (#4964) (#4968)
github-actions[bot] Jul 18, 2025
52f6d55
Update specification output
l-trotta Jul 18, 2025
1c7f1f2
Fix indices.delete_alias response (#2951) (#4970)
github-actions[bot] Jul 18, 2025
1ee3ff2
Update rest-api-spec (#4976)
github-actions[bot] Jul 21, 2025
53ef9ea
Bump @eslint/plugin-kit from 0.3.1 to 0.3.3 in /specification (#4978)…
github-actions[bot] Jul 21, 2025
0de1af0
Add missing index query parameter to msearch (#4980) (#4982)
pquentin Jul 21, 2025
d54e694
Adds custom inference service API docs (#4852) (#4994)
github-actions[bot] Jul 21, 2025
58698ce
Adds Cohere completion example. (#4990) (#4996)
github-actions[bot] Jul 21, 2025
0adb62a
added key field to filter bucket agg (#5013) (#5018)
github-actions[bot] Jul 22, 2025
7e7586c
[9.1] Update transform example update (#4998) (#5021)
lcawl Jul 22, 2025
f2834ab
update logic for x-metatags to use the standard term used by webteam …
georgewallace Jul 22, 2025
c116ebf
Update rest-api-spec (#5011)
github-actions[bot] Jul 23, 2025
5eb7816
Remove string variant for token_chars field (#5036) (#5040)
github-actions[bot] Jul 24, 2025
76cd5c9
[DOCS]: Clarify GET / response on Serverless (#4981) (#5044)
github-actions[bot] Jul 25, 2025
4f3be59
Update rest-api-spec (#5049)
github-actions[bot] Jul 28, 2025
e14351b
[ML] Add SageMaker (#4940) (#5051)
prwhelan Jul 29, 2025
186e642
ESQL: Update text formats documentation (#5054) (#5055)
github-actions[bot] Jul 30, 2025
907d11a
fix params type (#5046) (#5066)
github-actions[bot] Jul 31, 2025
7059432
Use strings instead of integer ids for simulate examples (#5061) (#5069)
github-actions[bot] Jul 31, 2025
25004b9
Updates Cohere inference API (#4896) (#4918)
github-actions[bot] Aug 1, 2025
220fd40
[9.1] Adds new 'none' and 'recursive' chunking strategies to Inferenc…
github-actions[bot] Aug 1, 2025
685b467
Adding vertex ai and alphabetizing (#5075)
jonathan-buttner Aug 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 5 additions & 7 deletions .github/validate-pr/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,18 @@ async function run() {
}
changedApis.sort((a, b) => a.api.localeCompare(b.api))

let comment = `Following you can find the validation changes against the target branch for the API${changedApis.length === 1 ? '' : 's'}.\n\n`
if (changedApis.length > 0) {
let comment = `Following you can find the validation changes for the API${changedApis.length === 1 ? '' : 's'} you have modified.\n\n`
comment += '| API | Status | Request | Response |\n'
comment += '| --- | --- | --- | --- |\n'
for (const change of changedApis) {
comment += buildDiffTableLine(change)
}
comment += `\nYou can validate ${changedApis.length === 1 ? 'this' : 'these'} API${changedApis.length === 1 ? '' : 's'} yourself by using the ${tick}make validate${tick} target.\n`

core.setOutput('has_results', 'true')
core.setOutput('comment_body', comment)
} else {
core.setOutput('has_results', 'false')
comment += '**No changes detected**.\n'
}
comment += `\nYou can validate ${changedApis.length === 1 ? 'this' : 'these'} API${changedApis.length === 1 ? '' : 's'} yourself by using the ${tick}make validate${tick} target.\n`
core.setOutput('comment_body', comment)

core.info('Done!')
}
Expand Down Expand Up @@ -236,4 +234,4 @@ function generateResponse (r) {
run().catch((err) => {
core.error(err)
process.exit(1)
})
})
1 change: 0 additions & 1 deletion .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ jobs:
body-includes: 'Following you can find the validation changes'

- name: Create or update comment
if: steps.validation.outputs.has_results == 'true'
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
11 changes: 4 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ output/schema/schema
# Test suite outputs
compiler/test/**/output/

# Temporary openAPI files
output/openapi/elasticsearch-serverless-openapi.tmp*.json
output/openapi/elasticsearch-serverless-openapi.examples.json
output/openapi/elasticsearch-openapi.tmp*.json
output/openapi/elasticsearch-openapi.examples.json
output/openapi/elasticsearch-serverless-openapi-docs.json
output/openapi/elasticsearch-openapi-docs.json
# Temporary openAPI documentation files
output/openapi/elasticsearch-serverless-openapi-docs*.json
output/openapi/elasticsearch-openapi-docs*.json
output/openapi/elasticsearch*.redirects.csv
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ dump-routes: ## Create a new schema with all generics expanded
@npm run dump-routes --prefix compiler

overlay-docs: ## Apply overlays to OpenAPI documents
@npx bump overlay "output/openapi/elasticsearch-serverless-openapi.json" "docs/overlays/elasticsearch-serverless-openapi-overlays.yaml" > "output/openapi/elasticsearch-serverless-openapi.tmp1.json"
@npx bump overlay "output/openapi/elasticsearch-serverless-openapi.tmp1.json" "docs/overlays/elasticsearch-shared-overlays.yaml" > "output/openapi/elasticsearch-serverless-openapi.tmp2.json"
@npx @redocly/cli bundle output/openapi/elasticsearch-serverless-openapi.tmp2.json --ext json -o output/openapi/elasticsearch-serverless-openapi.examples.json
@npx bump overlay "output/openapi/elasticsearch-openapi.json" "docs/overlays/elasticsearch-openapi-overlays.yaml" > "output/openapi/elasticsearch-openapi.tmp1.json"
@npx bump overlay "output/openapi/elasticsearch-openapi.tmp1.json" "docs/overlays/elasticsearch-shared-overlays.yaml" > "output/openapi/elasticsearch-openapi.tmp2.json"
@npx @redocly/cli bundle output/openapi/elasticsearch-openapi.tmp2.json --ext json -o output/openapi/elasticsearch-openapi.examples.json
rm output/openapi/elasticsearch-serverless-openapi.tmp*.json
rm output/openapi/elasticsearch-openapi.tmp*.json
@npx bump overlay "output/openapi/elasticsearch-serverless-openapi-docs.json" "docs/overlays/elasticsearch-serverless-openapi-overlays.yaml" > "output/openapi/elasticsearch-serverless-openapi-docs.tmp1.json"
@npx bump overlay "output/openapi/elasticsearch-serverless-openapi-docs.tmp1.json" "docs/overlays/elasticsearch-shared-overlays.yaml" > "output/openapi/elasticsearch-serverless-openapi-docs.tmp2.json"
@npx @redocly/cli bundle output/openapi/elasticsearch-serverless-openapi-docs.tmp2.json --ext json -o output/openapi/elasticsearch-serverless-openapi-docs-final.json
@npx bump overlay "output/openapi/elasticsearch-openapi-docs.json" "docs/overlays/elasticsearch-openapi-overlays.yaml" > "output/openapi/elasticsearch-openapi-docs.tmp1.json"
@npx bump overlay "output/openapi/elasticsearch-openapi-docs.tmp1.json" "docs/overlays/elasticsearch-shared-overlays.yaml" > "output/openapi/elasticsearch-openapi-docs.tmp2.json"
@npx @redocly/cli bundle output/openapi/elasticsearch-openapi-docs.tmp2.json --ext json -o output/openapi/elasticsearch-openapi-docs-final.json
rm output/openapi/elasticsearch-serverless-openapi-docs.tmp*.json
rm output/openapi/elasticsearch-openapi-docs.tmp*.json

generate-language-examples:
@node docs/examples/generate-language-examples.js
Expand All @@ -89,11 +89,11 @@ generate-language-examples-with-java:
lint-docs: ## Lint the OpenAPI documents after overlays
@npx @redocly/cli lint "output/openapi/elasticsearch-*.json" --config "docs/linters/redocly.yaml" --format stylish --max-problems 500

lint-docs-stateful: ## Lint only the elasticsearch-openapi.examples.json file
@npx @redocly/cli lint "output/openapi/elasticsearch-openapi.examples.json" --config "docs/linters/redocly.yaml" --format stylish --max-problems 500
lint-docs-stateful: ## Lint only the elasticsearch-openapi-docs-final.json file
@npx @redocly/cli lint "output/openapi/elasticsearch-openapi-docs-final.json" --config "docs/linters/redocly.yaml" --format stylish --max-problems 500

lint-docs-serverless: ## Lint only the serverless OpenAPI document after overlays
@npx @redocly/cli lint "output/openapi/elasticsearch-serverless-openapi.examples.json" --config "docs/linters/redocly.yaml" --format stylish --max-problems 500
@npx @redocly/cli lint "output/openapi/elasticsearch-serverless-openapi-docs-final.json" --config "docs/linters/redocly.yaml" --format stylish --max-problems 500

contrib: | generate license-check spec-format-fix transform-to-openapi filter-for-serverless lint-docs ## Pre contribution target

Expand Down
28 changes: 27 additions & 1 deletion compiler-rs/clients_schema/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pub trait Documented {
pub trait ExternalDocument {
fn ext_doc_id(&self) -> Option<&str>;
fn ext_doc_url(&self) -> Option<&str>;
fn ext_doc_description(&self) -> Option<&str>;
fn ext_previous_version_doc_url(&self) -> Option<&str>;
}

Expand Down Expand Up @@ -323,6 +324,9 @@ pub struct Property {
#[serde(skip_serializing_if = "Option::is_none")]
pub ext_doc_url: Option<String>,

#[serde(skip_serializing_if = "Option::is_none")]
pub ext_doc_description: Option<String>,

#[serde(skip_serializing_if = "Option::is_none")]
pub ext_previous_version_doc_url: Option<String>,

Expand Down Expand Up @@ -375,6 +379,10 @@ impl ExternalDocument for Property {
self.ext_doc_url.as_deref()
}

fn ext_doc_description(&self) -> Option<&str> {
self.ext_doc_description.as_deref()
}

fn ext_previous_version_doc_url(&self) -> Option<&str> {
self.ext_previous_version_doc_url.as_deref()
}
Expand Down Expand Up @@ -536,6 +544,9 @@ pub struct BaseType {
#[serde(skip_serializing_if = "Option::is_none")]
pub ext_doc_url: Option<String>,

#[serde(skip_serializing_if = "Option::is_none")]
pub ext_doc_description: Option<String>,

#[serde(skip_serializing_if = "Option::is_none")]
pub ext_previous_version_doc_url: Option<String>,

Expand Down Expand Up @@ -579,6 +590,7 @@ impl BaseType {
spec_location: None,
ext_doc_id: None,
ext_doc_url: None,
ext_doc_description: None,
ext_previous_version_doc_url: None,
}
}
Expand All @@ -603,6 +615,10 @@ impl ExternalDocument for BaseType {
self.ext_doc_url.as_deref()
}

fn ext_doc_description(&self) -> Option<&str> {
self.ext_doc_description.as_deref()
}

fn ext_previous_version_doc_url(&self) -> Option<&str> {
self.ext_previous_version_doc_url.as_deref()
}
Expand Down Expand Up @@ -635,6 +651,10 @@ impl<T: WithBaseType> ExternalDocument for T {
self.base().doc_url()
}

fn ext_doc_description(&self) -> Option<&str> {
self.base().ext_doc_description()
}

fn ext_previous_version_doc_url(&self) -> Option<&str> {
self.base().ext_previous_version_doc_url()
}
Expand Down Expand Up @@ -915,6 +935,9 @@ pub struct Endpoint {
#[serde(skip_serializing_if = "Option::is_none")]
pub ext_doc_url: Option<String>,

#[serde(skip_serializing_if = "Option::is_none")]
pub ext_doc_description: Option<String>,

#[serde(skip_serializing_if = "Option::is_none")]
pub ext_previous_version_doc_url: Option<String>,

Expand Down Expand Up @@ -968,6 +991,10 @@ impl ExternalDocument for Endpoint {
self.ext_doc_url.as_deref()
}

fn ext_doc_description(&self) -> Option<&str> {
self.ext_doc_description.as_deref()
}

fn ext_previous_version_doc_url(&self) -> Option<&str> {
self.ext_previous_version_doc_url.as_deref()
}
Expand Down Expand Up @@ -1003,7 +1030,6 @@ pub struct UrlTemplate {
pub struct ModelInfo {
pub title: String,
pub license: License,
pub version: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
6 changes: 4 additions & 2 deletions compiler-rs/clients_schema/src/transform/expand_generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,10 @@ pub fn expand(model: IndexedModel, config: ExpandConfig) -> anyhow::Result<Index

expand_behaviors(&mut resp.behaviors, &mappings, model, ctx)?;
expand_body(&mut resp.body, &mappings, model, ctx)?;

// TODO: exceptions

for exception in &mut resp.exceptions {
expand_body(&mut exception.body, &mappings, model, ctx)?;
}

Ok(resp.into())
}
Expand Down
7 changes: 7 additions & 0 deletions compiler-rs/clients_schema_to_openapi/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ pub struct Cli {
#[argh(option)]
pub namespace: Vec<String>,

/// the branch to generate [9.0, 8.19, current, etc... - default = current]
#[argh(option)]
pub branch: Option<String>,

/// add enum descriptions to property descriptions [default = true]
#[argh(switch)]
pub lift_enum_descriptions: bool,
Expand Down Expand Up @@ -72,9 +76,12 @@ impl From<Cli> for Configuration {
SchemaFlavor::Serverless => Some(Flavor::Serverless),
SchemaFlavor::Stack => Some(Flavor::Stack),
};

let branch = cli.branch;

Configuration {
flavor,
branch,
lift_enum_descriptions: cli.lift_enum_descriptions,
merge_multipath_endpoints: cli.merge_multipath_endpoints,
multipath_redirects: cli.multipath_redirects,
Expand Down
14 changes: 10 additions & 4 deletions compiler-rs/clients_schema_to_openapi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ use indexmap::IndexMap;

use clients_schema::{Availabilities, Availability, Flavor, IndexedModel, Stability, Visibility};
use openapiv3::{Components, OpenAPI};
use serde_json::Value;
use serde_json::{Map,Value};
use clients_schema::transform::ExpandConfig;
use crate::components::TypesAndComponents;

pub struct Configuration {
pub flavor: Option<Flavor>,
pub namespaces: Option<Vec<String>>,
pub branch: Option<String>,

/// If a property value is an enumeration, the description of possible values will be copied in the
/// property's description (also works for arrays of enums).
Expand Down Expand Up @@ -189,9 +190,14 @@ pub fn product_meta_as_extensions(namespace: &str, product_meta: &IndexMap<Strin
if let Some(meta) = product_meta.get(namespace) {
additional_namespace = format!(", {meta}");
}

let product_str = format!("elasticsearch{additional_namespace}");
result.insert("x-product-feature".to_string(), Value::String(product_str));

let product_str = format!("Elasticsearch{additional_namespace}");
let mut product_feature_list: Vec<Value> = Vec::new();
let mut product_feature: Map<String, Value> = Map::new();
product_feature.insert("name".to_string(),Value::String("product_name".to_string()));
product_feature.insert("content".to_string(),Value::String(product_str));
product_feature_list.push(Value::Object(product_feature));
result.insert("x-metaTags".to_string(), Value::Array(product_feature_list));
result
}

Expand Down
2 changes: 1 addition & 1 deletion compiler-rs/clients_schema_to_openapi/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub fn add_endpoint(
example: None,
examples: Default::default(),
explode: None, // Defaults to simple, i.e. comma-separated values for arrays
extensions: Default::default(),
extensions,
})
}

Expand Down
13 changes: 4 additions & 9 deletions compiler-rs/clients_schema_to_openapi/src/schemas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,14 @@ impl<'a> TypesAndComponents<'a> {
pub fn convert_external_docs(&self, obj: &impl clients_schema::ExternalDocument) -> Option<ExternalDocumentation> {
// FIXME: does the model contain resolved doc_id?
obj.ext_doc_url().map(|url| {
let branch: &str = self
.model
.info
.as_ref()
.and_then(|i| i.version.as_deref())
.unwrap_or("current");
let branch = self.config.branch.clone();
let mut extensions: IndexMap<String,serde_json::Value> = Default::default();
if let Some(previous_version_doc_url) = obj.ext_previous_version_doc_url() {
extensions.insert("x-previousVersionUrl".to_string(), serde_json::json!(previous_version_doc_url));
}
ExternalDocumentation {
description: None,
url: url.trim().replace("{branch}", branch),
description: obj.ext_doc_description().map(|desc| { desc.to_string() }),
url: url.trim().replace("{branch}", &branch.unwrap_or("current".to_string())),
extensions,
}
})
Expand Down Expand Up @@ -477,9 +472,9 @@ impl<'a> TypesAndComponents<'a> {
data.external_docs = self.convert_external_docs(prop);
data.deprecated = prop.deprecation.is_some();
data.description = self.property_description(prop)?;
data.default = prop.server_default.clone().map(|value| { serde_json::json!(value) });
data.extensions = crate::availability_as_extensions(&prop.availability, &self.config.flavor);
// TODO: prop.aliases as extensions
// TODO: prop.server_default as extension
// TODO: prop.doc_id as extension (new representation of since and stability)
// TODO: prop.es_quirk as extension?
// TODO: prop.codegen_name as extension?
Expand Down
Binary file modified compiler-rs/compiler-wasm-lib/pkg/compiler_wasm_lib_bg.wasm
Binary file not shown.
1 change: 1 addition & 0 deletions compiler-rs/openapi_to_clients_schema/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ fn generate_interface_def(
doc_url: None,
ext_doc_id: None,
ext_doc_url: None,
ext_doc_description: None,
ext_previous_version_doc_url: None,
codegen_name: None, // FIXME: extension in workplace search
description: None,
Expand Down
1 change: 1 addition & 0 deletions compiler/src/model/metamodel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ export class Endpoint {
docId?: string
extDocId?: string
extDocUrl?: string
extDocDescription?: string
extPreviousVersionDocUrl?: string
deprecation?: Deprecation
availability: Availabilities
Expand Down
3 changes: 3 additions & 0 deletions compiler/src/model/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,9 @@ export function hoistRequestAnnotations (
const docUrl = docIds.find(entry => entry[0] === value.trim())
assert(jsDocs, docUrl != null, `The @ext_doc_id '${value.trim()}' is not present in _doc_ids/table.csv`)
endpoint.extDocUrl = docUrl[1].replace(/\r/g, '')
if (docUrl[3].replace(/\r/g, '') !== '') {
endpoint.extDocDescription = docUrl[3].replace(/\r/g, '')
}
} else if (tag === 'availability') {
// The @availability jsTag is different than most because it allows
// multiple values within the same docstring, hence needing to parse
Expand Down
13 changes: 13 additions & 0 deletions compiler/src/steps/add-examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,18 @@ export default class ExamplesProcessor {
class BaseExamplesProcessor {
model: model.Model
specsFolder: string
static languageExamples: Record<string, model.ExampleAlternative[]> = {}

constructor (model: model.Model, specsFolder: string) {
this.model = model
this.specsFolder = specsFolder
if (Object.keys(BaseExamplesProcessor.languageExamples).length === 0) {
// load the language examples
const examplesJson = this.specsFolder + '/../docs/examples/languageExamples.json'
if (fs.existsSync(examplesJson)) {
BaseExamplesProcessor.languageExamples = JSON.parse(fs.readFileSync(examplesJson, 'utf8'))
}
}
}

// Log a 'warning' message.
Expand Down Expand Up @@ -139,6 +147,11 @@ class BaseExamplesProcessor {
const exampleFileContent = fs.readFileSync(filePath, 'utf8')
const exampleName = path.basename(fileName, path.extname(fileName))
const example: model.Example = yaml.load(exampleFileContent)
// find the language alternative examples and add them
const alternativeKey = 'specification/' + filePath.split('/specification/')[1]
if (BaseExamplesProcessor.languageExamples[alternativeKey] !== undefined) {
example.alternatives = BaseExamplesProcessor.languageExamples[alternativeKey]
}
// Some of the example files set their 'value' as a JSON string,
// and some files set their 'value' as an object. For consistency,
// if the value is not a JSON string, convert it to a JSON string.
Expand Down
Loading