Skip to content

Commit

Permalink
Merge branch 'main' into mes-364-styling-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mesellings authored Oct 6, 2024
2 parents f570772 + 0f88e86 commit ee0de56
Show file tree
Hide file tree
Showing 147 changed files with 1,807 additions and 1,151 deletions.
32 changes: 32 additions & 0 deletions api/camunda/camunda-openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Disclaimer: This is a modified version of the Camunda REST API specification, optimized for the documentation.

openapi: "3.0.3"
info:
title: Camunda 8 REST API
Expand Down Expand Up @@ -3004,19 +3006,34 @@ components:
description: The tenant ID of the decision requirements.
EvaluateDecisionRequest:
type: object
oneOf:
- $ref: "#/components/schemas/EvaluateDecisionRequestByKey"
- $ref: "#/components/schemas/EvaluateDecisionRequestById"
EvaluateDecisionRequestByKey:
type: object
allOf:
- $ref: "#/components/schemas/EvaluateDecisionRequestBase"
properties:
decisionDefinitionKey:
description: |
The unique key identifying the decision to be evaluated.
Cannot be used together with decisionDefinitionId.
type: integer
format: int64
EvaluateDecisionRequestById:
type: object
allOf:
- $ref: "#/components/schemas/EvaluateDecisionRequestBase"
properties:
decisionDefinitionId:
description: |
The ID of the decision to be evaluated.
Cannot be used together with decisionDefinitionKey. When using the decision ID, the latest
deployed version of the decision is used.
type: string
EvaluateDecisionRequestBase:
type: object
properties:
variables:
description: The message variables as JSON document.
additionalProperties: true
Expand Down Expand Up @@ -3532,13 +3549,25 @@ components:

CreateProcessInstanceRequest:
type: object
oneOf:
- $ref: "#/components/schemas/CreateProcessInstanceRequestByKey"
- $ref: "#/components/schemas/CreateProcessInstanceRequestById"
CreateProcessInstanceRequestByKey:
type: object
allOf:
- $ref: "#/components/schemas/CreateProcessInstanceRequestBase"
properties:
processDefinitionKey:
description: |
The unique key identifying the process definition, e.g. returned for a process in the
deploy resources endpoint. Cannot be used together with processDefinitionId.
type: integer
format: int64
CreateProcessInstanceRequestById:
type: object
allOf:
- $ref: "#/components/schemas/CreateProcessInstanceRequestBase"
properties:
processDefinitionId:
description: |
The BPMN process ID of the process definition to start an instance of.
Expand All @@ -3551,6 +3580,9 @@ components:
type: integer
format: int32
default: -1
CreateProcessInstanceRequestBase:
type: object
properties:
variables:
description: |
JSON object that will instantiate the variables for the root variable scope
Expand Down
227 changes: 197 additions & 30 deletions api/camunda/generation-strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,214 @@ const removeDuplicateVersionBadge = require("../remove-duplicate-version-badge")
const replace = require("replace-in-file");
const outputDir = "docs/apis-tools/camunda-api-rest/specifications";
const specFile = "api/camunda/camunda-openapi.yaml";
const fs = require("fs");

function preGenerateDocs() {
hackChangesetDescription();
const originalSpec = fs.readFileSync(specFile, "utf8");

console.log("adjusting C8 spec file...");

const specUpdates = [
addDisclaimer(),
...redefineCreateProcessInstanceRequest(originalSpec),
...redefineEvaluateDecisionRequest(originalSpec),
];

replace.sync({
files: specFile,
from: specUpdates.map((x) => x.from),
to: specUpdates.map((x) => x.to),
});
}

function postGenerateDocs() {
removeDuplicateVersionBadge(`${outputDir}/camunda-8-rest-api.info.mdx`);
}

module.exports = {
outputDir,
preGenerateDocs,
postGenerateDocs,
};
function addDisclaimer() {
// Adds a disclaimer to the very beginning of the file, so that people know this isn't the true spec.
return {
from: /^/,
to: `# Disclaimer: This is a modified version of the Camunda REST API specification, optimized for the documentation.
function hackChangesetDescription() {
// This is a temporary hack, until https://github.com/camunda/camunda-docs/issues/3568 is resolved.
// The OpenAPI generator plugin we're using does not use the correct `description` property
// for the `UserTaskUpdateRequest` object. Instead of picking up the actual property description,
// it picks up the description of the first merged schema in the `allOf` property (i.e. from the `Changeset` schema).
// This adjustment replaces the description of the `Changeset` schema with the current description of
// the `UserTaskUpdateRequest.changeset` property.
console.log("hacking changeset description...");
replace.sync({
files: `${specFile}`,
from: /^ description: A map of changes.$/m,
to: ` description: |
JSON object with changed task attribute values.
`,
};
}

The following attributes can be adjusted with this endpoint, additional attributes
will be ignored:
function redefineCreateProcessInstanceRequest(originalSpec) {
// Redefines the CreateProcessInstanceRequest schema to describe a union of two possible request bodies.
// This union type does not work upstream, but we can rewrite it here to more clearly describe the schema.

* \`candidateGroups\` - reset by providing an empty list
* \`candidateUsers\` - reset by providing an empty list
* \`dueDate\` - reset by providing an empty String
* \`followUpDate\` - reset by providing an empty String
if (originalSpec.includes("CreateProcessInstanceRequestBase")) {
// Make this a repeatable task by checking if it's run already.
console.log("skipping redefineCreateProcessInstanceRequest...");
return [];
}

Providing any of those attributes with a \`null\` value or omitting it preserves
the persisted attribute's value.
// Diff created by these changes:
// CreateProcessInstanceRequest:
// type: object
//+ oneOf:
//+ - $ref: "#/components/schemas/CreateProcessInstanceRequestByKey"
//+ - $ref: "#/components/schemas/CreateProcessInstanceRequestById"
//+ CreateProcessInstanceRequestByKey:
//+ type: object
//+ allOf:
//+ - $ref: "#/components/schemas/CreateProcessInstanceRequestBase"
// properties:
// processDefinitionKey:
// ...
//+ CreateProcessInstanceRequestById:
//+ type: object
//+ allOf:
//+ - $ref: "#/components/schemas/CreateProcessInstanceRequestBase"
//+ properties:
// processDefinitionId:
// ...
// processDefinitionVersion:
// ...
//+ CreateProcessInstanceRequestBase:
//+ type: object
//+ properties:
// variables:
// ...
// tenantId:
// ...
// ...

The assignee cannot be adjusted with this endpoint, use the Assign task endpoint.
This ensures correct event emission for assignee changes.`,
});
return [
// 1. Convert the main request to a oneOf union and define the first possible type.
{
// match the start of the CreateProcessInstanceRequest object
from: / CreateProcessInstanceRequest:\n type: object/m,

// append the `oneOf` declaration to define the union type.
// Then a definition for the first possible type, so that it includes the `processDefinitionKey` property.
to: ` CreateProcessInstanceRequest:
type: object
oneOf:
- $ref: "#/components/schemas/CreateProcessInstanceRequestByKey"
- $ref: "#/components/schemas/CreateProcessInstanceRequestById"
CreateProcessInstanceRequestByKey:
type: object
allOf:
- $ref: "#/components/schemas/CreateProcessInstanceRequestBase"`,
},

// 2. Define the second possible type, to include the `processDefinitionId` property.
{
// match the start of the CreateProcessInstanceRequestByKey object, up until the `processDefinitionId` property (non-inclusive).
from: / CreateProcessInstanceRequestByKey:[\s\S]*?(?=\s*processDefinitionId:)/m,

// append the second possible type definition, so that it includes the `processDefinitionId`.
to: `$&
CreateProcessInstanceRequestById:
type: object
allOf:
- $ref: "#/components/schemas/CreateProcessInstanceRequestBase"
properties:`,
},

// 3. Define a base type to contain the common properties, starting before the `variables` property.
{
// match the start of the CreateProcessInstanceRequestById object, up until the `variables` property (non-inclusive).
from: / CreateProcessInstanceRequestById:[\s\S]*?(?=\s*variables:)/m,
// append the base type definition, so that it includes all remaining properties.
to: `$&
CreateProcessInstanceRequestBase:
type: object
properties:`,
},
];
}

function redefineEvaluateDecisionRequest(originalSpec) {
// Redefines the EvaluateDecisionRequest schema to describe a union of two possible request bodies.
// This union type does not work upstream, but we can rewrite it here to more clearly describe the schema.

if (originalSpec.includes("EvaluateDecisionRequestBase")) {
// Make this a repeatable task by checking if it's run already.
console.log("skipping redefineEvaluateDecisionRequest...");
return [];
}

// Diff created by these changes:
// EvaluateDecisionRequest:
// type: object
//+ oneOf:
//+ - $ref: "#/components/schemas/EvaluateDecisionRequestByKey"
//+ - $ref: "#/components/schemas/EvaluateDecisionRequestById"
//+ EvaluateDecisionRequestByKey:
//+ type: object
//+ allOf:
//+ - $ref: "#/components/schemas/EvaluateDecisionRequestBase"
// properties:
// decisionDefinitionKey:
// ...
//+ EvaluateDecisionRequestById:
//+ type: object
//+ allOf:
//+ - $ref: "#/components/schemas/EvaluateDecisionRequestBase"
//+ properties:
// decisionDefinitionId:
// ...
//+ EvaluateDecisionRequestBase:
//+ type: object
//+ properties:
// variables:
// ...
// tenantId:
// ...
// ...

return [
// 1. Convert the main request to a oneOf union and define the first possible type.
{
// match the start of the EvaluateDecisionRequest object
from: / EvaluateDecisionRequest:\n type: object/m,

// append the `oneOf` declaration to define the union type.
// Then a definition for the first possible type, so that it includes the `decisionDefinitionKey` property.
to: ` EvaluateDecisionRequest:
type: object
oneOf:
- $ref: "#/components/schemas/EvaluateDecisionRequestByKey"
- $ref: "#/components/schemas/EvaluateDecisionRequestById"
EvaluateDecisionRequestByKey:
type: object
allOf:
- $ref: "#/components/schemas/EvaluateDecisionRequestBase"`,
},

// 2. Define the second possible type, to include the `decisionDefinitionId` property.
{
// match the start of the EvaluateDecisionRequestByKey object, up until the `decisionDefinitionId` property (non-inclusive).
from: / EvaluateDecisionRequestByKey:[\s\S]*?(?=\s*decisionDefinitionId:)/m,

// append the second possible type definition, so that it includes the `decisionDefinitionId`.
to: `$&
EvaluateDecisionRequestById:
type: object
allOf:
- $ref: "#/components/schemas/EvaluateDecisionRequestBase"
properties:`,
},

// 3. Define a base type to contain the common properties, starting before the `variables` property.
{
// match the start of the CreateProcessInstanceRequestById object, up until the `variables` property (non-inclusive).
from: / EvaluateDecisionRequestById:[\s\S]*?(?=\s*variables:)/m,
// append the base type definition, so that it includes all remaining properties.
to: `$&
EvaluateDecisionRequestBase:
type: object
properties:`,
},
];
}

module.exports = {
outputDir,
preGenerateDocs,
postGenerateDocs,
};
1 change: 1 addition & 0 deletions api/zeebe/generation-strategy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const replace = require("replace-in-file");
const removeDuplicateVersionBadge = require("../remove-duplicate-version-badge");

const outputDir = "docs/apis-tools/zeebe-api-rest/specifications";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "Iterate through all known partitions and activate jobs up to the r
sidebar_label: "Activate jobs"
hide_title: true
hide_table_of_contents: true
api: eJztWVtvGzcW/isHfNkYO5aUbtqmaruAaqdbZVvXsJW2gO0HzsyRhjaHnJAcyaqg/14ccm6SRomC7r7FgGDN8PBcv3MhtWGOLywb37G3OmYPEUvRJkYUTmjFxmzq0HCH4DKjy0UGXEp4UnqloODGCaKywFUKPHFiSZSPOrZQFuA0uAzB4PsSrcMUcv4s8jIf3CsWser1Dzpds/HGPwqDKRs7U2LEEq0cKkdLvCikSDhJGj5aUmrDbJJhzumb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nWjq2SXc9mnXPuUa59y7VSu0c2QsCuFhhpgOHHQ4XaFpxGd3EZNu8YKXc+5WfB+B73gkmDnE2YPnO9W2L6f7HKl7X60pmgczA607BOrAkyiIp6svNBu4GihPb9d8rTIYs5esttXd3P2E/o0pirnSBJ5yPrl+OW4lyuRnuA4vZkxb6GHXasUVGwpp3vZeuJzGO/3D+RIFC5pt3e0zbsnFFwLPS3I9zUcSnmOOz17IrzxH36sQPL633MXZypjt8298KsnThcxffiqpubmTX2hOe69LBx3bvPuq70P3Uuv8cFdTEPpUL9QTqMSk11nEXKqA2UwHn7exT8cSmmMuRJ7XS1HDtD5B6Nuwy9KcDIhpw8CFHxBExvkEqZaYn/1K6w8wrLPhwQcj+6qhC/BuQiHEDeK/Lb6/zBR4SjFtD0qRZjR5fS3N9dX04tfZ5evru9eXYDj0D5ZFyBKsZRnLT2mRzdOB5bumr71f/seoUSGFU92hOolMwK/s39XloL7oNStVQwQc5/Q98FuF3Ij3uhkv6fXEKJxqL1/aPKfnsDUnxBd9XD3OsGlN+5i7q/HMBoX7o7o+GZqP6h2TKNI5Pa9tA+tinbz+92csqX8joTOonir+Ya+P8HfSfAW//CgnMNdIrr3uwB1fFnwJdF7vvTzN/JLCPs=
sidebar_class_name: "post api-method"
info_path: docs/apis-tools/camunda-api-rest/specifications/camunda-8-rest-api
custom_edit_url: null
Expand Down
Loading

0 comments on commit ee0de56

Please sign in to comment.