@cparra/apexdocs 2.10.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -66,18 +66,18 @@ Constructs a SampleClass with an argument.
66
66
  ## Fields
67
67
  ### Common Constants
68
68
 
69
- * `ANOTHER_CONSTANT` → `String` (*Inherited*)
70
- * `A_CONSTANT` → `String` (*Inherited*) [`NAMESPACEACCESSIBLE` ] - This is a constant.
71
- * `listOfStrings` → `List<String>` (*Inherited*)
69
+ * `ANOTHER_CONSTANT` → `String`
70
+ * `A_CONSTANT` → `String` [`NAMESPACEACCESSIBLE` ] - This is a constant.
71
+ * `listOfStrings` → `List<String>`
72
72
  ---
73
73
  ### 'General' Constants
74
74
 
75
- * `GENERAL_ANOTHER_CONSTANT` → `String` (*Inherited*)
76
- * `GENERAL_A_CONSTANT` → `String` (*Inherited*) [`NAMESPACEACCESSIBLE` ] - This is a constant.
75
+ * `GENERAL_ANOTHER_CONSTANT` → `String`
76
+ * `GENERAL_A_CONSTANT` → `String` [`NAMESPACEACCESSIBLE` ] - This is a constant.
77
77
  ---
78
78
  ### Other variables
79
79
 
80
- * `someVariable` → `String` (*Inherited*)
80
+ * `someVariable` → `String`
81
81
  ---
82
82
  ## Properties
83
83
 
@@ -96,20 +96,21 @@ This is a String property.
96
96
 
97
97
  ---
98
98
  ## Methods
99
- ### `static sampleMethod(String argument1, String argument2)`
99
+ ### A method group
100
+ ##### `static sampleMethod(String argument1, String argument2)`
100
101
 
101
102
  `NAMESPACEACCESSIBLE`
102
103
 
103
104
  Executes commands based on the passed in argument.
104
105
 
105
- #### Parameters
106
+ ###### Parameters
106
107
 
107
108
  |Param|Description|
108
109
  |---|---|
109
110
  |`argument1`|Argument1 to debug|
110
111
  |`argument2`|Argument2 to debug|
111
112
 
112
- #### Return
113
+ ###### Return
113
114
 
114
115
  **Type**
115
116
 
@@ -119,21 +120,23 @@ String
119
120
 
120
121
  Empty string
121
122
 
122
- #### Example
123
+ ###### Example
123
124
  ```apex
124
125
  String result = SampleClass.testMethod();
125
126
  System.debug(result);
126
127
  ```
127
128
 
128
129
 
129
- ### `static anotherSampleMethod(String arg1)`
130
+ ##### `static anotherSampleMethod(String arg1)`
130
131
 
131
132
  Something here
132
133
 
133
134
 
134
135
  **Arg1** The arg1 description
135
136
 
136
- ### `static call()`
137
+ ---
138
+ ### Other
139
+ ##### `static call()`
137
140
 
138
141
  Calls the method. This methods allows you to call it.
139
142
 
@@ -0,0 +1,13 @@
1
+ # nspc.MemberGrouping
2
+ ## Fields
3
+ ### Group old syntax
4
+
5
+ * `anotherInGroup1` → `String`
6
+ * `inGroup1` → `String`
7
+ ---
8
+ ### Group new syntax
9
+ Group's description
10
+
11
+ * `anotherInGroup2` → `String`
12
+ * `inGroup2` → `String` - Description for constant in group 2
13
+ ---
@@ -12,9 +12,6 @@ Account related operations
12
12
  Sample HTTP Delete method with references to other types.
13
13
 
14
14
 
15
- **Http Request Body** description: This is an example of a request body required: true schema: SampleClass
16
-
17
-
18
15
  **Http Parameter** name: limit in: header required: true description: My sample description. schema: SampleClass
19
16
 
20
17
 
@@ -0,0 +1,14 @@
1
+ # nspc.SampleRestResourceWithoutApexDocs
2
+
3
+ `RESTRESOURCE`
4
+
5
+ Order related operations
6
+
7
+ ## Methods
8
+ ### `static doGet(String param1, Reference1 param2)`
9
+
10
+ `HTTPGET`
11
+ ### `static doPatch(String param1, Reference1 param2)`
12
+
13
+ `HTTPPATCH`
14
+ ---
package/docs/README.md CHANGED
@@ -13,6 +13,9 @@
13
13
  ### [nspc.InterfaceWithInheritance](/Misc-Group/nspc.InterfaceWithInheritance.md)
14
14
 
15
15
 
16
+ ### [nspc.MemberGrouping](/Misc-Group/nspc.MemberGrouping.md)
17
+
18
+
16
19
  ### [nspc.ParentClass](/Misc-Group/nspc.ParentClass.md)
17
20
 
18
21
 
@@ -48,6 +51,12 @@ Account related operations
48
51
  Contact related operations
49
52
 
50
53
 
54
+
55
+ ### [nspc.SampleRestResourceWithoutApexDocs](/Misc-Group/nspc.SampleRestResourceWithoutApexDocs.md)
56
+
57
+ Order related operations
58
+
59
+
51
60
  ## Main
52
61
 
53
62
  ### [nspc.GroupedClass](/Main/nspc.GroupedClass.md)
package/docs/restapi.json CHANGED
@@ -335,6 +335,71 @@
335
335
  }
336
336
  }
337
337
  }
338
+ },
339
+ "/Order/*": {
340
+ "description": "Order related operations",
341
+ "get": {
342
+ "requestBody": {
343
+ "content": {
344
+ "application/json": {
345
+ "schema": {
346
+ "type": "object",
347
+ "properties": {
348
+ "param1": {
349
+ "type": "string"
350
+ },
351
+ "param2": {
352
+ "$ref": "#/components/schemas/Reference1"
353
+ }
354
+ }
355
+ }
356
+ }
357
+ }
358
+ },
359
+ "responses": {
360
+ "200": {
361
+ "description": "Status code 200",
362
+ "content": {
363
+ "application/json": {
364
+ "schema": {
365
+ "type": "string"
366
+ }
367
+ }
368
+ }
369
+ }
370
+ }
371
+ },
372
+ "patch": {
373
+ "requestBody": {
374
+ "content": {
375
+ "application/json": {
376
+ "schema": {
377
+ "type": "object",
378
+ "properties": {
379
+ "param1": {
380
+ "type": "string"
381
+ },
382
+ "param2": {
383
+ "$ref": "#/components/schemas/Reference1"
384
+ }
385
+ }
386
+ }
387
+ }
388
+ }
389
+ },
390
+ "responses": {
391
+ "200": {
392
+ "description": "Status code 200",
393
+ "content": {
394
+ "application/json": {
395
+ "schema": {
396
+ "type": "string"
397
+ }
398
+ }
399
+ }
400
+ }
401
+ }
402
+ }
338
403
  }
339
404
  },
340
405
  "components": {
@@ -0,0 +1,16 @@
1
+ public class MemberGrouping {
2
+ // @start-group Group old syntax
3
+ public static final String inGroup1;
4
+ public static final String anotherInGroup1;
5
+ // @end-group
6
+
7
+ /**
8
+ * @start-group Group new syntax
9
+ * @description Group's description
10
+ */
11
+
12
+ /** @description Description for constant in group 2 */
13
+ public static final String inGroup2;
14
+ public static final String anotherInGroup2;
15
+ /** @end-group */
16
+ }
@@ -69,6 +69,8 @@ public with sharing class SampleClass {
69
69
  System.debug('Constructor');
70
70
  }
71
71
 
72
+
73
+ // @start-group A method group
72
74
  /**
73
75
  * @description Executes commands based on the passed in argument.
74
76
  * @example
@@ -92,6 +94,7 @@ public with sharing class SampleClass {
92
94
  System.debug('something');
93
95
  return '';
94
96
  }
97
+ // @end-group
95
98
 
96
99
 
97
100
  /**
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @description Order related operations
3
+ */
4
+ @RestResource(urlMapping='/Order/*')
5
+ global with sharing class SampleRestResourceWithoutApexDocs {
6
+ @HttpGet
7
+ global static String doGet(String param1, Reference1 param2) {
8
+ return 'Hello World!';
9
+ }
10
+
11
+ @HttpPatch
12
+ global static String doPatch(String param1, Reference1 param2) {
13
+ return 'Hello World!';
14
+ }
15
+ }
@@ -51,7 +51,12 @@ function addFieldSection(markdownFile, mirrorModel, startingHeadingLevel, groupe
51
51
  if ((_b = mirrorModel.docComment) === null || _b === void 0 ? void 0 : _b.description) {
52
52
  description = ` - ${(_c = mirrorModel.docComment) === null || _c === void 0 ? void 0 : _c.description}`;
53
53
  }
54
- markdownFile.addListItem(`\`${mirrorModel.name}\` → \`${mirrorModel.typeReference.rawDeclaration}\` (*Inherited*) ${annotations} ${description}`);
54
+ let listItemText = `\`${mirrorModel.name}\` → \`${mirrorModel.typeReference.rawDeclaration}\``;
55
+ if (mirrorModel.inherited) {
56
+ listItemText += '(*Inherited*)';
57
+ }
58
+ listItemText += `${annotations} ${description}`;
59
+ markdownFile.addListItem(listItemText);
55
60
  markdownFile.addBlankLine();
56
61
  }
57
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"field-declaration-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/field-declaration-util.ts"],"names":[],"mappings":";;;AAGA,SAAgB,YAAY,CAC1B,YAA0B,EAC1B,MAAsE,EACtE,oBAA4B,EAC5B,OAAO,GAAG,KAAK;IAEf,YAAY,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM;SACH,IAAI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AI,WAAW,GAAG,EAAE,CAAC;QACrB,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC;QACxD,IAAI,cAAc,EAAE;YAClB,WAAW,IAAI,IAAI,CAAC;SACrB;QACD,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YAC7C,WAAW,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;QACzD,CAAC,CAAC,CAAC;QACH,IAAI,cAAc,EAAE;YAClB,WAAW,IAAI,GAAG,CAAC;SACpB;QAED,gDAAgD;QAChD,IAAI,WAAW,GAAG,EAAE,CAAC;QACrB,IAAI,MAAA,WAAW,CAAC,UAAU,0CAAE,WAAW,EAAE;YACvC,WAAW,GAAG,MAAM,MAAA,WAAW,CAAC,UAAU,0CAAE,WAAW,EAAE,CAAC;SAC3D;QACD,YAAY,CAAC,WAAW,CACtB,KAAK,WAAW,CAAC,IAAI,UAAU,WAAW,CAAC,aAAa,CAAC,cAAc,oBAAoB,WAAW,IAAI,WAAW,EAAE,CACxH,CAAC;QACF,YAAY,CAAC,YAAY,EAAE,CAAC;KAC7B;AACH,CAAC"}
1
+ {"version":3,"file":"field-declaration-util.js","sourceRoot":"","sources":["../../../src/model/markdown-generation-util/field-declaration-util.ts"],"names":[],"mappings":";;;AAGA,SAAgB,YAAY,CAC1B,YAA0B,EAC1B,MAAsE,EACtE,oBAA4B,EAC5B,OAAO,GAAG,KAAK;IAEf,YAAY,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM;SACH,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACrB,IAAI,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;YAAE,OAAO,CAAC,CAAC,CAAC;QACvC,IAAI,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI;YAAE,OAAO,CAAC,CAAC;QACtC,OAAO,CAAC,CAAC;IACX,C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W,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC;QACzD,CAAC,CAAC,CAAC;QACH,IAAI,cAAc,EAAE;YAClB,WAAW,IAAI,GAAG,CAAC;SACpB;QAED,gDAAgD;QAChD,IAAI,WAAW,GAAG,EAAE,CAAC;QACrB,IAAI,MAAA,WAAW,CAAC,UAAU,0CAAE,WAAW,EAAE;YACvC,WAAW,GAAG,MAAM,MAAA,WAAW,CAAC,UAAU,0CAAE,WAAW,EAAE,CAAC;SAC3D;QAED,IAAI,YAAY,GAAG,KAAK,WAAW,CAAC,IAAI,UAAU,WAAW,CAAC,aAAa,CAAC,cAAc,IAAI,CAAC;QAC/F,IAAI,WAAW,CAAC,SAAS,EAAE;YACzB,YAAY,IAAI,eAAe,CAAC;SACjC;QACD,YAAY,IAAI,GAAG,WAAW,IAAI,WAAW,EAAE,CAAC;QAEhD,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QACvC,YAAY,CAAC,YAAY,EAAE,CAAC;KAC7B;AACH,CAAC"}
@@ -83,7 +83,8 @@ class MarkdownTypeFile extends markdown_file_1.MarkdownFile {
83
83
  else {
84
84
  const groupedConstructors = this.group(methods);
85
85
  for (const key in groupedConstructors) {
86
- this.startGroup(key);
86
+ // For the group description, we can take the first one, since they all have the same description.
87
+ this.startGroup(key, groupedConstructors[key][0].groupDescription);
87
88
  const constructorsForGroup = groupedConstructors[key];
88
89
  (0, markdown_generation_util_1.declareMethod)(this, constructorsForGroup, this.headingLevel, className);
89
90
  this.endGroup();
@@ -98,16 +99,20 @@ class MarkdownTypeFile extends markdown_file_1.MarkdownFile {
98
99
  else {
99
100
  const groupedFields = this.group(fieldsOrProperties);
100
101
  for (const key in groupedFields) {
101
- this.startGroup(key);
102
+ // For the group description, we can take the first one, since they all have the same description.
103
+ this.startGroup(key, groupedFields[key][0].groupDescription);
102
104
  const fieldsForGroup = groupedFields[key];
103
105
  (0, markdown_generation_util_1.declareField)(this, fieldsForGroup, this.headingLevel, true);
104
106
  this.endGroup();
105
107
  }
106
108
  }
107
109
  }
108
- startGroup(groupName) {
110
+ startGroup(groupName, groupDescription) {
109
111
  this.headingLevel = this.headingLevel + 2;
110
112
  this.addTitle(groupName, this.headingLevel);
113
+ if (groupDescription) {
114
+ this.addText(groupDescription);
115
+ }
111
116
  }
112
117
  endGroup() {
113
118
  this.headingLevel = this.headingLevel - 2;
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-type-file.js","sourceRoot":"","sources":["../../src/model/markdown-type-file.ts"],"names":[],"mappings":";;;AAQA,sEAAkE;AAElE,mDAA+C;AAC/C,yEAAsF;AACtF,kGAAyF;AAEzF,0CAAuC;AAUvC,MAAa,gBAAiB,SAAQ,4BAAY;IAChD,YAAoB,IAAU,EAAU,eAAuB,CAAC,EAAE,aAAsB,EAAU,UAAU,KAAK;QAC/G,KAAK,CACH,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,kBAAkB,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,EAC5D,oCAAwB,CAAC,iBAAiB,CAAC,IAAI,CAAC,CACjD,CAAC;QAJgB,SAAI,GAAJ,IAAI,CAAM;QAAU,iBAAY,GAAZ,YAAY,CAAY;QAAkC,YAAO,GAAP,OAAO,CAAQ;QAK/G,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;SAC7B;QACD,MAAM,MAAM,GAAG,8BAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAEM,iBAAiB,CAAC,UAAgB;QACvC,IAAI,YAAY,CAAC;QACjB,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC;SAChC;aAAM;YACL,YAAY,GAAG,GAAG,mBAAQ,CAAC,WAAW,EAAE,CAAC,kBAAkB,EAAE,GAAG,UAAU,CAAC,IAA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AAC,CAAC;QAC1C,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC5C,IAAI,gBAAgB,EAAE;YACpB,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;SAChC;IACH,CAAC;IAEO,QAAQ;QACd,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;IAC5C,CAAC;IAEO,KAAK,CAAC,IAAkB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,MAAgB,EAAE,IAAI,EAAE,EAAE;;YAC5C,MAAM,SAAS,GAAW,MAAA,IAAI,CAAC,KAAK,mCAAI,OAAO,CAAC;YAChD,MAAM,KAAK,GAAiB,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;YACpD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,MAAM,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;YAC1B,OAAO,MAAM,CAAC;QAChB,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;CACF;AAvID,4CAuIC"}
@@ -9,9 +9,12 @@ export declare class MethodParser {
9
9
  constructor(openApiModel: OpenApi);
10
10
  parseMethod(classMirror: ClassMirror, httpUrlEndpoint: string, httpMethodKey: HttpOperations): void;
11
11
  private parseHttpAnnotation;
12
+ private addToOpenApiStrategy;
12
13
  private addRequestBodyToOpenApi;
13
14
  private addParametersToOpenApi;
14
15
  private addHttpResponsesToOpenApi;
16
+ private fallbackHttpRequestBodyParser;
17
+ private getFallbackHttpResponseParser;
15
18
  private addReference;
16
19
  }
17
20
  export {};
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MethodParser = void 0;
4
4
  const yaml = require("js-yaml");
5
5
  const ClassMirrorWrapper_1 = require("../../../model/apex-type-wrappers/ClassMirrorWrapper");
6
+ const ReferenceBuilder_1 = require("./ReferenceBuilder");
6
7
  const ParameterObjectBuilder_1 = require("./ParameterObjectBuilder");
7
8
  const ResponsesBuilder_1 = require("./ResponsesBuilder");
8
9
  const RequestBodyBuilder_1 = require("./RequestBodyBuilder");
@@ -28,14 +29,17 @@ class MethodParser {
28
29
  if ((_a = httpMethod.docComment) === null || _a === void 0 ? void 0 : _a.description) {
29
30
  this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].description = httpMethod.docComment.description;
30
31
  }
31
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, 'http-request-body', (inYaml, urlValue) => this.addRequestBodyToOpenApi(inYaml, urlValue, httpMethodKey));
32
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, 'http-parameter', (inYaml, urlValue) => this.addParametersToOpenApi(inYaml, urlValue, httpMethodKey));
33
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, 'http-response', (inYaml, urlValue) => this.addHttpResponsesToOpenApi(inYaml, urlValue, httpMethodKey));
32
+ this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-request-body', this.addRequestBodyToOpenApi.bind(this), this.fallbackHttpRequestBodyParser(httpUrlEndpoint, httpMethodKey));
33
+ this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-parameter', this.addParametersToOpenApi.bind(this));
34
+ this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, httpMethodKey, 'http-response', this.addHttpResponsesToOpenApi.bind(this), this.getFallbackHttpResponseParser(httpUrlEndpoint, httpMethodKey));
34
35
  }
35
- parseHttpAnnotation(httpGetMethod, urlValue, annotationName, addToOpenApi) {
36
+ parseHttpAnnotation(httpMethod, urlValue, httpMethodKey, annotationName, addToOpenApi, fallbackParser) {
36
37
  var _a;
37
- const annotations = (_a = httpGetMethod.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((annotation) => annotation.name === annotationName);
38
+ const annotations = (_a = httpMethod.docComment) === null || _a === void 0 ? void 0 : _a.annotations.filter((annotation) => annotation.name === annotationName);
38
39
  if (!(annotations === null || annotations === void 0 ? void 0 : annotations.length)) {
40
+ if (fallbackParser) {
41
+ fallbackParser(httpMethod);
42
+ }
39
43
  return;
40
44
  }
41
45
  for (const annotation of annotations) {
@@ -44,36 +48,93 @@ class MethodParser {
44
48
  if (!inYaml) {
45
49
  return;
46
50
  }
47
- addToOpenApi(inYaml, urlValue);
51
+ this.addToOpenApiStrategy(inYaml, urlValue, httpMethodKey, addToOpenApi);
48
52
  }
49
53
  }
50
- addRequestBodyToOpenApi(inYaml, urlValue, httpMethodKey) {
54
+ addToOpenApiStrategy(inYaml, urlValue, httpMethodKey, addToOpenApi) {
51
55
  // Convert the YAML into a JSON object.
52
56
  const inJson = yaml.load(inYaml);
53
57
  const requestBodyResponse = new RequestBodyBuilder_1.RequestBodyBuilder().build(inJson);
54
- this.openApiModel.paths[urlValue][httpMethodKey].requestBody = requestBodyResponse.body;
58
+ addToOpenApi(inJson, urlValue, httpMethodKey);
55
59
  this.addReference(requestBodyResponse);
56
60
  }
57
- addParametersToOpenApi(inYaml, urlValue, httpMethodKey) {
58
- // Convert the YAML into a JSON object.
59
- const inJson = yaml.load(inYaml);
60
- const parameterObjectResponse = new ParameterObjectBuilder_1.ParameterObjectBuilder().build(inJson);
61
+ addRequestBodyToOpenApi(input, urlValue, httpMethodKey) {
62
+ const requestBodyResponse = new RequestBodyBuilder_1.RequestBodyBuilder().build(input);
63
+ this.openApiModel.paths[urlValue][httpMethodKey].requestBody = requestBodyResponse.body;
64
+ }
65
+ addParametersToOpenApi(input, urlValue, httpMethodKey) {
66
+ const parameterObjectResponse = new ParameterObjectBuilder_1.ParameterObjectBuilder().build(input);
61
67
  if (this.openApiModel.paths[urlValue][httpMethodKey].parameters === undefined) {
62
68
  // If no parameters have been defined yet, initialize the list.
63
69
  this.openApiModel.paths[urlValue][httpMethodKey].parameters = [];
64
70
  }
65
71
  this.openApiModel.paths[urlValue][httpMethodKey].parameters.push(parameterObjectResponse.body);
66
- this.addReference(parameterObjectResponse);
67
72
  }
68
- addHttpResponsesToOpenApi(inYaml, urlValue, httpMethodKey) {
69
- // Convert the YAML into a JSON object.
70
- const inJson = yaml.load(inYaml);
71
- const responseObjectResponse = new ResponsesBuilder_1.ResponsesBuilder().build(inJson);
73
+ addHttpResponsesToOpenApi(input, urlValue, httpMethodKey) {
74
+ const responseObjectResponse = new ResponsesBuilder_1.ResponsesBuilder().build(input);
72
75
  if (this.openApiModel.paths[urlValue][httpMethodKey].responses === undefined) {
73
76
  this.openApiModel.paths[urlValue][httpMethodKey].responses = {};
74
77
  }
75
- this.openApiModel.paths[urlValue][httpMethodKey].responses[inJson.statusCode] = responseObjectResponse.body;
76
- this.addReference(responseObjectResponse);
78
+ this.openApiModel.paths[urlValue][httpMethodKey].responses[input.statusCode] = responseObjectResponse.body;
79
+ }
80
+ fallbackHttpRequestBodyParser(httpUrlEndpoint, httpMethodKey) {
81
+ return (methodMirror) => {
82
+ // If the Apex method receives parameters, they will be interpreted by Salesforce as a JSON
83
+ // object, with each key of the object being the parameter name.
84
+ const parameters = methodMirror.parameters;
85
+ if (!parameters.length) {
86
+ return;
87
+ }
88
+ const propertiesObject = {};
89
+ parameters.forEach((currentParameter) => {
90
+ const propertyKey = currentParameter.name;
91
+ const propertyReference = new ReferenceBuilder_1.ReferenceBuilder().getReferenceType(currentParameter.typeReference);
92
+ propertiesObject[propertyKey] = propertyReference.schema;
93
+ this.addReference({
94
+ reference: {
95
+ entrypointReferenceObject: propertyReference.schema,
96
+ referenceComponents: propertyReference.referenceComponents,
97
+ },
98
+ });
99
+ });
100
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].requestBody = {
101
+ content: {
102
+ 'application/json': {
103
+ schema: {
104
+ type: 'object',
105
+ properties: propertiesObject,
106
+ },
107
+ },
108
+ },
109
+ };
110
+ };
111
+ }
112
+ getFallbackHttpResponseParser(httpUrlEndpoint, httpMethodKey) {
113
+ return (methodMirror) => {
114
+ var _a, _b;
115
+ // Parses methods that return an object (as opposed to void).
116
+ const returnType = methodMirror.typeReference;
117
+ if (returnType.type.toLowerCase() === 'void') {
118
+ return;
119
+ }
120
+ const reference = new ReferenceBuilder_1.ReferenceBuilder().getReferenceType(returnType);
121
+ this.addReference({
122
+ reference: {
123
+ entrypointReferenceObject: reference.schema,
124
+ referenceComponents: reference.referenceComponents,
125
+ },
126
+ });
127
+ if (this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses === undefined) {
128
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses = {};
129
+ }
130
+ // Successful responses with a non-void return type always return a status code of 2000
131
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey].responses['200'] = {
132
+ description: (_b = (_a = methodMirror.docComment) === null || _a === void 0 ? void 0 : _a.description) !== null && _b !== void 0 ? _b : 'Status code 200',
133
+ content: {
134
+ 'application/json': { schema: reference.schema },
135
+ },
136
+ };
137
+ };
77
138
  }
78
139
  addReference(referenceHolder) {
79
140
  if (referenceHolder.reference) {
@@ -1 +1 @@
1
- {"version":3,"file":"MethodParser.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/MethodParser.ts"],"names":[],"mappings":";;;AAEA,gCAAgC;AAChC,6FAA0F;AAE1F,qEAAkE;AAClE,yDAAsD;AAMtD,6DAA0D;AAM1D;;GAEG;AACH,MAAa,YAAY;IACvB,YAAmB,YAAqB;QAArB,iBAAY,GAAZ,YAAY,CAAS;IAAG,CAAC;IAErC,WAAW,CAAC,WAAwB,EAAE,eAAuB,EAAE,aAA6B;;QACjG,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAAC,WAAW,CAAC,CAAC;QAC/D,iGAAiG;QACjG,qCAAqC;QACrC,MAAM,WAAW,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,OAAO,aAAa,EAAE,CAAC,CAAC;QACtF,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;YACvB,OAAO;SACR;QAED,qFAAqF;QACrF,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAElC,I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AAY,CAAC,UAAW,CAAC,OAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;YACnF,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;CACF;AApHD,oCAoHC"}
1
+ {"version":3,"file":"MethodParser.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/MethodParser.ts"],"names":[],"mappings":";;;AAEA,gCAAgC;AAChC,6FAA0F;AAC1F,yDAAiE;AACjE,qEAAkE;AAClE,yDAAsD;AAMtD,6DAA0D;AAS1D;;GAEG;AACH,MAAa,YAAY;IACvB,YAAmB,YAAqB;QAArB,iBAAY,GAAZ,YAAY,CAAS;IAAG,CAAC;IAErC,WAAW,CAAC,WAAwB,EAAE,eAAuB,EAAE,aAA6B;;QACjG,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAAC,WAAW,CAAC,CAAC;QAC/D,iGAAiG;QACjG,qCAAqC;QACrC,MAAM,WAAW,GAAG,kBAAkB,CAAC,sBAAsB,CAAC,OAAO,aAAa,EAAE,CAAC,CAAC;QACtF,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE;YACvB,OAAO;SACR;QAED,qFAAqF;QACrF,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;QAC7D,IAAI,MAAA,UAAU,CAAC,UAAU,0CAAE,WAAW,EAAE;YACtC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,aAAa,CAAE,CAAC,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC;SAC1G;QAED,IAAI,CAAC,mBAAmB,CACtB,UAAU,EACV,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,EACvC,IAAI,CAAC,6BAA6B,CAAC,eA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7B,2FAA2F;YAC3F,uDAAuD;YACvD,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,KAAK,SAAS,EAAE;gBAC9C,IAAI,CAAC,YAAY,CAAC,UAAU,GAAG;oBAC7B,OAAO,EAAE,EAAE;iBACZ,CAAC;aACH;YAED,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,mBAAmB,CAAC,MAAM,EAAE;gBACzD,OAAO;aACR;YAED,iEAAiE;YACjE,eAAe,CAAC,SAAS,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAChE,uEAAuE;gBACvE,IAAI,CAAC,YAAY,CAAC,UAAW,CAAC,OAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;YACnF,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;CACF;AAzND,oCAyNC"}
@@ -1,4 +1,5 @@
1
- import { ReferenceObject, SchemaObjectArray, SchemaObjectObject } from '../../../model/openapi/open-api-types';
1
+ import { ReferenceObject, SchemaObject, SchemaObjectArray, SchemaObjectObject } from '../../../model/openapi/open-api-types';
2
+ import { ReferencedType } from '@cparra/apex-reflection/index';
2
3
  export declare class ReferenceBuilder {
3
4
  build(referencedTypeName: string): Reference;
4
5
  /**
@@ -12,10 +13,14 @@ export declare class ReferenceBuilder {
12
13
  private handleOverriddenSchema;
13
14
  private getReferenceName;
14
15
  private buildMainReferenceComponent;
15
- private getReferenceType;
16
+ getReferenceType(typeInMirror: ReferencedType): SchemaObjectReferencePair;
16
17
  private buildCollectionPair;
17
18
  private isReferenceString;
18
19
  }
20
+ type SchemaObjectReferencePair = {
21
+ schema: SchemaObject;
22
+ referenceComponents: ReferenceComponent[];
23
+ };
19
24
  /**
20
25
  * In case where the Request Body contains a reference, this contains information about the handled reference
21
26
  */
@@ -31,3 +36,4 @@ export type ReferenceComponent = {
31
36
  /** Parsed representation of the referenced object as an OpenApi Schema object */
32
37
  schema: SchemaObjectObject | SchemaObjectArray;
33
38
  };
39
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ReferenceBuilder.js","sourceRoot":"","sources":["../../../../src/transpiler/openapi/parsers/ReferenceBuilder.ts"],"names":[],"mappings":";;;AAAA,gCAAgC;AAQhC,sEAA8E;AAO9E,MAAa,gBAAgB;IAA7B;QAwMU,sBAAiB,GAAG,CAAC,YAAiB,EAA0B,EAAE;YACxE,OAAO,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,YAAY,MAAM,CAAC;QAC5E,CAAC,CAAC;IACJ,CAAC;IA1MC,KAAK,CAAC,kBAA0B;QAC9B,MAAM,CAAC,oBAAoB,EAAE,YAAY,CAAC,GAAG,IAAI,CAAC,iCAAiC,CAAC,kBAAkB,CAAC,CAAC;QACxG,MAAM,oBAAoB,GAAG,kCAAe,CAAC,WAAW,EAAE,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;QAElG,IAAI,CAAC,oBAAoB,EAAE;YACzB,MAAM,IAAI,KAAK,CAAC,wBAAwB,oBAAoB,kBAAkB,CAAC,CAAC;SACjF;QACD,IAAI,oBAAoB,CAAC,IAAI,CAAC,SAAS,KAAK,OAAO,EAAE;YACnD,MAAM,IAAI,KAAK,CACb,2DAA2D,oBAAoB,CAAC,IAAI,CAAC,SAAS,GAAG,CAClG,CAAC;SACH;QACD,MAAM,0BAA0B,mCAAQ,oBAAoB,KAAE,YAAY,EAAE,YAAY,GAAE,CAAC;QAC3F,OAAO,IAAI,CAAC,sBAAsB,CAAC,0BAA0B,CAAC,CAAC;IACjE,CAAC;IAED;;;;;OAKG;IACK,iCAAiC,CAAC,kBAA0B;QAClE,kBAAkB,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC;QACtD,IAAI,kBAAkB,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC9E,kBAAkB,GAAG,kBAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,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AAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;gBAChF,IAAI,CAAC,cAAc,EAAE;oBACnB,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,CAAC;iBAChE;gBACD,MAAM,SAAS,GAAG,IAAI,CAAC,sBAAsB,iCAAM,cAAc,KAAE,YAAY,EAAE,KAAK,IAAG,CAAC;gBAC1F,OAAO;oBACL,MAAM,EAAE,SAAS,CAAC,yBAAyB;oBAC3C,mBAAmB,EAAE,CAAC,GAAG,SAAS,CAAC,mBAAmB,CAAC;iBACxD,CAAC;SACL;IACH,CAAC;IAEO,mBAAmB,CAAC,YAA4B;QACtD,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAE,YAA+B,CAAC,MAAM,CAAC,CAAC;QACtF,OAAO;YACL,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE;YACvD,mBAAmB,EAAE,CAAC,GAAG,cAAc,CAAC,mBAAmB,CAAC;SAC7D,CAAC;IACJ,CAAC;CAKF;AA3MD,4CA2MC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cparra/apexdocs",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "Library with CLI capabilities to generate documentation for Salesforce Apex classes.",
5
5
  "keywords": [
6
6
  "apex",
@@ -66,7 +66,7 @@
66
66
  ]
67
67
  },
68
68
  "dependencies": {
69
- "@cparra/apex-reflection": "2.0.2",
69
+ "@cparra/apex-reflection": "2.1.1",
70
70
  "chalk": "^4.1.2",
71
71
  "fast-xml-parser": "^4.0.1",
72
72
  "js-yaml": "^4.1.0",
@@ -64,9 +64,14 @@ function addFieldSection(
64
64
  if (mirrorModel.docComment?.description) {
65
65
  description = ` - ${mirrorModel.docComment?.description}`;
66
66
  }
67
- markdownFile.addListItem(
68
- `\`${mirrorModel.name}\` → \`${mirrorModel.typeReference.rawDeclaration}\` (*Inherited*) ${annotations} ${description}`,
69
- );
67
+
68
+ let listItemText = `\`${mirrorModel.name}\` → \`${mirrorModel.typeReference.rawDeclaration}\``;
69
+ if (mirrorModel.inherited) {
70
+ listItemText += '(*Inherited*)';
71
+ }
72
+ listItemText += `${annotations} ${description}`;
73
+
74
+ markdownFile.addListItem(listItemText);
70
75
  markdownFile.addBlankLine();
71
76
  }
72
77
  }
@@ -16,6 +16,7 @@ import { Settings } from '../settings';
16
16
 
17
17
  interface GroupAware {
18
18
  group?: string;
19
+ groupDescription?: string;
19
20
  }
20
21
 
21
22
  interface GroupMap {
@@ -109,8 +110,9 @@ export class MarkdownTypeFile extends MarkdownFile implements WalkerListener {
109
110
  } else {
110
111
  const groupedConstructors = this.group(methods);
111
112
  for (const key in groupedConstructors) {
112
- this.startGroup(key);
113
- const constructorsForGroup = groupedConstructors[key] as ConstructorMirror[];
113
+ // For the group description, we can take the first one, since they all have the same description.
114
+ this.startGroup(key, groupedConstructors[key][0].groupDescription);
115
+ const constructorsForGroup = groupedConstructors[key] as (ConstructorMirror | MethodMirrorWithInheritance)[];
114
116
  declareMethod(this, constructorsForGroup, this.headingLevel, className);
115
117
  this.endGroup();
116
118
  }
@@ -126,17 +128,21 @@ export class MarkdownTypeFile extends MarkdownFile implements WalkerListener {
126
128
  } else {
127
129
  const groupedFields = this.group(fieldsOrProperties);
128
130
  for (const key in groupedFields) {
129
- this.startGroup(key);
130
- const fieldsForGroup = groupedFields[key] as FieldMirrorWithInheritance[];
131
+ // For the group description, we can take the first one, since they all have the same description.
132
+ this.startGroup(key, groupedFields[key][0].groupDescription);
133
+ const fieldsForGroup = groupedFields[key] as (FieldMirrorWithInheritance | PropertyMirrorWithInheritance)[];
131
134
  declareField(this, fieldsForGroup, this.headingLevel, true);
132
135
  this.endGroup();
133
136
  }
134
137
  }
135
138
  }
136
139
 
137
- private startGroup(groupName: string) {
140
+ private startGroup(groupName: string, groupDescription?: string) {
138
141
  this.headingLevel = this.headingLevel + 2;
139
142
  this.addTitle(groupName, this.headingLevel);
143
+ if (groupDescription) {
144
+ this.addText(groupDescription);
145
+ }
140
146
  }
141
147
 
142
148
  private endGroup() {
@@ -2,7 +2,7 @@ import { ClassMirror, MethodMirror } from '@cparra/apex-reflection';
2
2
  import { OpenApi } from '../../../model/openapi/open-api';
3
3
  import * as yaml from 'js-yaml';
4
4
  import { ClassMirrorWrapper } from '../../../model/apex-type-wrappers/ClassMirrorWrapper';
5
- import { Reference } from './ReferenceBuilder';
5
+ import { Reference, ReferenceBuilder } from './ReferenceBuilder';
6
6
  import { ParameterObjectBuilder } from './ParameterObjectBuilder';
7
7
  import { ResponsesBuilder } from './ResponsesBuilder';
8
8
  import {
@@ -11,8 +11,11 @@ import {
11
11
  ApexDocParameterObject,
12
12
  } from '../../../model/openapi/apex-doc-types';
13
13
  import { RequestBodyBuilder } from './RequestBodyBuilder';
14
+ import { ApexDocSchemaAware } from './Builder';
15
+ import { PropertiesObject, ReferenceObject } from '../../../model/openapi/open-api-types';
14
16
 
15
- type AddToOpenApi = (inYaml: string, urlValue: string) => void;
17
+ type FallbackMethodParser = (methodMirror: MethodMirror) => void;
18
+ type AddToOpenApi<T extends ApexDocSchemaAware> = (input: T, urlValue: string, httpMethodKey: HttpOperations) => void;
16
19
 
17
20
  type HttpOperations = 'get' | 'put' | 'post' | 'delete' | 'patch';
18
21
 
@@ -39,28 +42,47 @@ export class MethodParser {
39
42
  this.openApiModel.paths[httpUrlEndpoint][httpMethodKey]!.description = httpMethod.docComment.description;
40
43
  }
41
44
 
42
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, 'http-request-body', (inYaml, urlValue) =>
43
- this.addRequestBodyToOpenApi(inYaml, urlValue, httpMethodKey),
45
+ this.parseHttpAnnotation<ApexDocHttpRequestBody>(
46
+ httpMethod,
47
+ httpUrlEndpoint,
48
+ httpMethodKey,
49
+ 'http-request-body',
50
+ this.addRequestBodyToOpenApi.bind(this),
51
+ this.fallbackHttpRequestBodyParser(httpUrlEndpoint, httpMethodKey),
44
52
  );
45
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, 'http-parameter', (inYaml, urlValue) =>
46
- this.addParametersToOpenApi(inYaml, urlValue, httpMethodKey),
53
+
54
+ this.parseHttpAnnotation<ApexDocParameterObject>(
55
+ httpMethod,
56
+ httpUrlEndpoint,
57
+ httpMethodKey,
58
+ 'http-parameter',
59
+ this.addParametersToOpenApi.bind(this),
47
60
  );
48
- this.parseHttpAnnotation(httpMethod, httpUrlEndpoint, 'http-response', (inYaml, urlValue) =>
49
- this.addHttpResponsesToOpenApi(inYaml, urlValue, httpMethodKey),
61
+
62
+ this.parseHttpAnnotation<ApexDocHttpResponse>(
63
+ httpMethod,
64
+ httpUrlEndpoint,
65
+ httpMethodKey,
66
+ 'http-response',
67
+ this.addHttpResponsesToOpenApi.bind(this),
68
+ this.getFallbackHttpResponseParser(httpUrlEndpoint, httpMethodKey),
50
69
  );
51
70
  }
52
71
 
53
- private parseHttpAnnotation(
54
- httpGetMethod: MethodMirror,
72
+ private parseHttpAnnotation<T extends ApexDocSchemaAware>(
73
+ httpMethod: MethodMirror,
55
74
  urlValue: string,
75
+ httpMethodKey: HttpOperations,
56
76
  annotationName: string,
57
- addToOpenApi: AddToOpenApi,
77
+ addToOpenApi: AddToOpenApi<T>,
78
+ fallbackParser?: FallbackMethodParser,
58
79
  ) {
59
- const annotations = httpGetMethod.docComment?.annotations.filter(
60
- (annotation) => annotation.name === annotationName,
61
- );
80
+ const annotations = httpMethod.docComment?.annotations.filter((annotation) => annotation.name === annotationName);
62
81
 
63
82
  if (!annotations?.length) {
83
+ if (fallbackParser) {
84
+ fallbackParser(httpMethod);
85
+ }
64
86
  return;
65
87
  }
66
88
 
@@ -72,46 +94,128 @@ export class MethodParser {
72
94
  return;
73
95
  }
74
96
 
75
- addToOpenApi(inYaml, urlValue);
97
+ this.addToOpenApiStrategy<T>(inYaml, urlValue, httpMethodKey, addToOpenApi);
76
98
  }
77
99
  }
78
100
 
79
- private addRequestBodyToOpenApi(inYaml: string, urlValue: string, httpMethodKey: HttpOperations) {
101
+ private addToOpenApiStrategy<T extends ApexDocSchemaAware>(
102
+ inYaml: string,
103
+ urlValue: string,
104
+ httpMethodKey: HttpOperations,
105
+ addToOpenApi: AddToOpenApi<T>,
106
+ ): void {
80
107
  // Convert the YAML into a JSON object.
81
- const inJson = yaml.load(inYaml) as ApexDocHttpRequestBody;
108
+ const inJson = yaml.load(inYaml) as T;
82
109
  const requestBodyResponse = new RequestBodyBuilder().build(inJson);
83
110
 
84
- this.openApiModel.paths[urlValue][httpMethodKey]!.requestBody = requestBodyResponse.body;
111
+ addToOpenApi(inJson, urlValue, httpMethodKey);
85
112
 
86
113
  this.addReference(requestBodyResponse);
87
114
  }
88
115
 
89
- private addParametersToOpenApi(inYaml: string, urlValue: string, httpMethodKey: HttpOperations) {
90
- // Convert the YAML into a JSON object.
91
- const inJson = yaml.load(inYaml) as ApexDocParameterObject;
92
- const parameterObjectResponse = new ParameterObjectBuilder().build(inJson);
116
+ private addRequestBodyToOpenApi(
117
+ input: ApexDocHttpRequestBody,
118
+ urlValue: string,
119
+ httpMethodKey: HttpOperations,
120
+ ): void {
121
+ const requestBodyResponse = new RequestBodyBuilder().build(input);
122
+ this.openApiModel.paths[urlValue][httpMethodKey]!.requestBody = requestBodyResponse.body;
123
+ }
124
+
125
+ private addParametersToOpenApi(input: ApexDocParameterObject, urlValue: string, httpMethodKey: HttpOperations): void {
126
+ const parameterObjectResponse = new ParameterObjectBuilder().build(input);
93
127
 
94
128
  if (this.openApiModel.paths[urlValue][httpMethodKey]!.parameters === undefined) {
95
129
  // If no parameters have been defined yet, initialize the list.
96
130
  this.openApiModel.paths[urlValue][httpMethodKey]!.parameters = [];
97
131
  }
98
132
  this.openApiModel.paths[urlValue][httpMethodKey]!.parameters!.push(parameterObjectResponse.body);
99
-
100
- this.addReference(parameterObjectResponse);
101
133
  }
102
134
 
103
- private addHttpResponsesToOpenApi(inYaml: string, urlValue: string, httpMethodKey: HttpOperations) {
104
- // Convert the YAML into a JSON object.
105
- const inJson = yaml.load(inYaml) as ApexDocHttpResponse;
106
- const responseObjectResponse = new ResponsesBuilder().build(inJson);
135
+ private addHttpResponsesToOpenApi(input: ApexDocHttpResponse, urlValue: string, httpMethodKey: HttpOperations): void {
136
+ const responseObjectResponse = new ResponsesBuilder().build(input);
107
137
 
108
138
  if (this.openApiModel.paths[urlValue][httpMethodKey]!.responses === undefined) {
109
139
  this.openApiModel.paths[urlValue][httpMethodKey]!.responses = {};
110
140
  }
111
141
 
112
- this.openApiModel.paths[urlValue][httpMethodKey]!.responses![inJson.statusCode] = responseObjectResponse.body;
142
+ this.openApiModel.paths[urlValue][httpMethodKey]!.responses![input.statusCode] = responseObjectResponse.body;
143
+ }
144
+
145
+ private fallbackHttpRequestBodyParser(
146
+ httpUrlEndpoint: string,
147
+ httpMethodKey: 'get' | 'put' | 'post' | 'delete' | 'patch',
148
+ ) {
149
+ return (methodMirror: MethodMirror) => {
150
+ // If the Apex method receives parameters, they will be interpreted by Salesforce as a JSON
151
+ // object, with each key of the object being the parameter name.
152
+ const parameters = methodMirror.parameters;
153
+
154
+ if (!parameters.length) {
155
+ return;
156
+ }
157
+
158
+ const propertiesObject: PropertiesObject = {};
159
+ parameters.forEach((currentParameter) => {
160
+ const propertyKey = currentParameter.name;
161
+ const propertyReference = new ReferenceBuilder().getReferenceType(currentParameter.typeReference);
162
+
163
+ propertiesObject[propertyKey] = propertyReference.schema;
164
+
165
+ this.addReference({
166
+ reference: {
167
+ entrypointReferenceObject: propertyReference.schema as ReferenceObject,
168
+ referenceComponents: propertyReference.referenceComponents,
169
+ },
170
+ });
171
+ });
172
+
173
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey]!.requestBody = {
174
+ content: {
175
+ 'application/json': {
176
+ schema: {
177
+ type: 'object',
178
+ properties: propertiesObject,
179
+ },
180
+ },
181
+ },
182
+ };
183
+ };
184
+ }
185
+
186
+ private getFallbackHttpResponseParser(
187
+ httpUrlEndpoint: string,
188
+ httpMethodKey: 'get' | 'put' | 'post' | 'delete' | 'patch',
189
+ ) {
190
+ return (methodMirror: MethodMirror) => {
191
+ // Parses methods that return an object (as opposed to void).
192
+ const returnType = methodMirror.typeReference;
193
+
194
+ if (returnType.type.toLowerCase() === 'void') {
195
+ return;
196
+ }
197
+
198
+ const reference = new ReferenceBuilder().getReferenceType(returnType);
199
+
200
+ this.addReference({
201
+ reference: {
202
+ entrypointReferenceObject: reference.schema as ReferenceObject,
203
+ referenceComponents: reference.referenceComponents,
204
+ },
205
+ });
206
+
207
+ if (this.openApiModel.paths[httpUrlEndpoint][httpMethodKey]!.responses === undefined) {
208
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey]!.responses = {};
209
+ }
113
210
 
114
- this.addReference(responseObjectResponse);
211
+ // Successful responses with a non-void return type always return a status code of 2000
212
+ this.openApiModel.paths[httpUrlEndpoint][httpMethodKey]!.responses!['200'] = {
213
+ description: methodMirror.docComment?.description ?? 'Status code 200',
214
+ content: {
215
+ 'application/json': { schema: reference.schema },
216
+ },
217
+ };
218
+ };
115
219
  }
116
220
 
117
221
  private addReference(referenceHolder: { reference?: Reference }): void {
@@ -159,7 +159,7 @@ export class ReferenceBuilder {
159
159
  ];
160
160
  }
161
161
 
162
- private getReferenceType(typeInMirror: ReferencedType): SchemaObjectReferencePair {
162
+ public getReferenceType(typeInMirror: ReferencedType): SchemaObjectReferencePair {
163
163
  // Returns a valid type supported by OpenApi from a received Apex type.
164
164
  const typeName = typeInMirror.type.toLowerCase();
165
165
  switch (typeName) {