@cparra/apexdocs 2.9.0 → 2.10.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.
Files changed (69) hide show
  1. package/README.md +111 -66
  2. package/docs/Main/nspc.GroupedClass.md +10 -0
  3. package/docs/Main/{SampleClass.md → nspc.SampleClass.md} +6 -6
  4. package/docs/Misc-Group/nspc.AnotherInterface.md +1 -0
  5. package/docs/Misc-Group/{ChildClass.md → nspc.ChildClass.md} +4 -4
  6. package/docs/Misc-Group/{GrandparentClass.md → nspc.GrandparentClass.md} +1 -1
  7. package/docs/Misc-Group/{InterfaceWithInheritance.md → nspc.InterfaceWithInheritance.md} +3 -3
  8. package/docs/Misc-Group/{ParentClass.md → nspc.ParentClass.md} +2 -2
  9. package/docs/Misc-Group/{Reference1.md → nspc.Reference1.md} +1 -1
  10. package/docs/Misc-Group/nspc.Reference2.md +12 -0
  11. package/docs/Misc-Group/{Reference3.md → nspc.Reference3.md} +1 -1
  12. package/docs/Misc-Group/{Reference4.md → nspc.Reference4.md} +1 -1
  13. package/docs/Misc-Group/{Reference5.md → nspc.Reference5.md} +1 -1
  14. package/docs/Misc-Group/{Reference6.md → nspc.Reference6.md} +1 -1
  15. package/docs/Misc-Group/{SampleClassWithoutModifier.md → nspc.SampleClassWithoutModifier.md} +1 -1
  16. package/docs/Misc-Group/{SampleRestResource.md → nspc.SampleRestResource.md} +1 -1
  17. package/docs/Misc-Group/{SampleRestResourceWithInnerClass.md → nspc.SampleRestResourceWithInnerClass.md} +1 -1
  18. package/docs/README.md +19 -19
  19. package/docs/Sample-Interfaces/{SampleInterface.md → nspc.SampleInterface.md} +1 -1
  20. package/docs/index.html +22 -22
  21. package/docs/{openapi.json → restapi.json} +12 -13
  22. package/examples/force-app/main/default/restapi/SampleRestResource.cls +0 -4
  23. package/examples/force-app/main/default/restapi/references/Reference2.cls +6 -0
  24. package/lib/cli/generate.js +12 -0
  25. package/lib/cli/generate.js.map +1 -1
  26. package/lib/model/markdown-type-file.d.ts +4 -3
  27. package/lib/model/markdown-type-file.js +13 -4
  28. package/lib/model/markdown-type-file.js.map +1 -1
  29. package/lib/model/openapi/open-api.d.ts +1 -1
  30. package/lib/model/openapi/open-api.js.map +1 -1
  31. package/lib/model/openapi/openapi-type-file.js +3 -2
  32. package/lib/model/openapi/openapi-type-file.js.map +1 -1
  33. package/lib/settings.d.ts +5 -0
  34. package/lib/settings.js +12 -0
  35. package/lib/settings.js.map +1 -1
  36. package/lib/test-helpers/DocCommentAnnotationBuilder.d.ts +2 -0
  37. package/lib/test-helpers/DocCommentAnnotationBuilder.js +6 -1
  38. package/lib/test-helpers/DocCommentAnnotationBuilder.js.map +1 -1
  39. package/lib/test-helpers/FieldMirrorBuilder.d.ts +3 -1
  40. package/lib/test-helpers/FieldMirrorBuilder.js +6 -0
  41. package/lib/test-helpers/FieldMirrorBuilder.js.map +1 -1
  42. package/lib/test-helpers/SettingsBuilder.js +1 -0
  43. package/lib/test-helpers/SettingsBuilder.js.map +1 -1
  44. package/lib/transpiler/markdown/class-file-generatorHelper.js +2 -1
  45. package/lib/transpiler/markdown/class-file-generatorHelper.js.map +1 -1
  46. package/lib/transpiler/openapi/open-api-docs-processor.d.ts +1 -0
  47. package/lib/transpiler/openapi/open-api-docs-processor.js +4 -2
  48. package/lib/transpiler/openapi/open-api-docs-processor.js.map +1 -1
  49. package/lib/transpiler/openapi/parsers/ReferenceBuilder.d.ts +2 -0
  50. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js +35 -5
  51. package/lib/transpiler/openapi/parsers/ReferenceBuilder.js.map +1 -1
  52. package/package.json +5 -5
  53. package/src/cli/generate.ts +13 -0
  54. package/src/model/markdown-type-file.ts +14 -4
  55. package/src/model/openapi/open-api.ts +1 -1
  56. package/src/model/openapi/openapi-type-file.ts +3 -2
  57. package/src/service/__tests__/apex-file-reader.spec.ts +1 -0
  58. package/src/settings.ts +17 -0
  59. package/src/test-helpers/DocCommentAnnotationBuilder.ts +7 -1
  60. package/src/test-helpers/FieldMirrorBuilder.ts +8 -1
  61. package/src/test-helpers/SettingsBuilder.ts +1 -0
  62. package/src/transpiler/markdown/class-file-generatorHelper.ts +2 -1
  63. package/src/transpiler/openapi/open-api-docs-processor.ts +4 -2
  64. package/src/transpiler/openapi/parsers/ReferenceBuilder.ts +41 -5
  65. package/src/transpiler/openapi/parsers/__tests__/ReferenceBuilder.spec.ts +85 -0
  66. package/docs/API/SampleClassWithoutModifier.md +0 -11
  67. package/docs/Main/GroupedClass.md +0 -10
  68. package/docs/Misc-Group/AnotherInterface.md +0 -1
  69. package/docs/Misc-Group/Reference2.md +0 -7
package/README.md CHANGED
@@ -126,6 +126,8 @@ The CLI supports the following parameters:
126
126
  | --defaultGroupName | N/A | Defines the `@group` name to be used when a file does not specify it. | `Miscellaneous` | No |
127
127
  | --sanitizeHtml | N/A | When on, any special character within your ApexDocs is converted into its HTML code representation. This is specially useful when generic objects are described within the docs, e.g. "List< Foo>", "Map<Foo, Bar>" because otherwise the content within < and > would be treated as HTML tags and not shown in the output. Content in @example blocks are never sanitized. | `Apex REST Api` | No |
128
128
  | --openApiTitle | N/A | If using "openapi" as the target generator, this allows you to specify the OpenApi title value. | true | No |
129
+ | --namespace | N/A | The package namespace, if any. If this value is provided the namespace will be added as a prefix to all of the parsed files. If generating an OpenApi definition, it will be added to the file's Server Url. | N/A | No |
130
+ | --openApiFileName | N/A | If using "openapi" as the target generator, this allows you to specify the name of the output file. | `openapi` | No |
129
131
 
130
132
  ### Importing to your project
131
133
 
@@ -374,17 +376,17 @@ or a fully defined custom schema (See the `Custom Schemas` section below).
374
376
 
375
377
  Example
376
378
  ```apex
377
- /**
378
- * @description This is a sample HTTP Post method
379
- * @http-request-body
380
- * description: This is an example of a request body
381
- * required: true
382
- * schema: ClassName
383
- */
384
- @HttpPost
385
- global static void doPost() {
386
- ///...
387
- }
379
+ /**
380
+ * @description This is a sample HTTP Post method
381
+ * @http-request-body
382
+ * description: This is an example of a request body
383
+ * required: true
384
+ * schema: ClassName
385
+ */
386
+ @HttpPost
387
+ global static void doPost() {
388
+ ///...
389
+ }
388
390
  ```
389
391
 
390
392
  📝 Note that each parameter of this annotation is expected to be on its own line. Parameters are treated as YAML,
@@ -400,25 +402,25 @@ whether it is `required` or not, a `description`, and a `schema`.
400
402
 
401
403
  Example
402
404
  ```apex
403
- /**
404
- * @description This is a sample HTTP Post method
405
- * @return A String SObject.
406
- * @http-parameter
407
- * name: limit
408
- * in: query
409
- * required: true
410
- * description: Limits the number of items on a page
411
- * schema:
412
- * type: integer
413
- * @http-parameter
414
- * name: complex
415
- * in: cookie
416
- * schema: MyClassName
417
- */
418
- @HttpPost
419
- global static String doPost() {
420
- // ..
421
- }
405
+ /**
406
+ * @description This is a sample HTTP Post method
407
+ * @return A String SObject.
408
+ * @http-parameter
409
+ * name: limit
410
+ * in: query
411
+ * required: true
412
+ * description: Limits the number of items on a page
413
+ * schema:
414
+ * type: integer
415
+ * @http-parameter
416
+ * name: complex
417
+ * in: cookie
418
+ * schema: MyClassName
419
+ */
420
+ @HttpPost
421
+ global static String doPost() {
422
+ // ..
423
+ }
422
424
  ```
423
425
 
424
426
  📝 Note that each parameter of this annotation is expected to be on its own line. Parameters are treated as YAML,
@@ -434,22 +436,22 @@ If no `description` is provided then one will be automatically built using the `
434
436
  📝 Note that you can specify as many `@http-parameter` annotations as needed.
435
437
 
436
438
  ```apex
437
- /**
438
- * @description This is a sample HTTP Post method
439
- * @return A String SObject.
440
- * @http-response
441
- * statusCode: 200
442
- * schema: SuccessfulResponseClassName
443
- * @http-response
444
- * statusCode: 500
445
- * description: Status Code 500 - An internal server error occurred.
446
- * schema:
447
- * type: string
448
- */
449
- @HttpPost
450
- global static String doPost() {
451
- // ...
452
- }
439
+ /**
440
+ * @description This is a sample HTTP Post method
441
+ * @return A String SObject.
442
+ * @http-response
443
+ * statusCode: 200
444
+ * schema: SuccessfulResponseClassName
445
+ * @http-response
446
+ * statusCode: 500
447
+ * description: Status Code 500 - An internal server error occurred.
448
+ * schema:
449
+ * type: string
450
+ */
451
+ @HttpPost
452
+ global static String doPost() {
453
+ // ...
454
+ }
453
455
  ```
454
456
 
455
457
  #### Class References
@@ -459,6 +461,49 @@ class will be parsed by the ApexDocs tool and automatically converted to a refer
459
461
 
460
462
  The tool will parse the class and create a reference that complies with [Apex's support for User-Defined Types](https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_methods.htm#ApexRESTUserDefinedTypes)
461
463
 
464
+ ##### Reference Overrides
465
+
466
+ When dealing with references, there might be cases when you want to manually tell the parser what type of object a property
467
+ or field is. For example, let's say we have a class that looks as follows
468
+
469
+ ```apex
470
+ public class MyClass {
471
+ public Object myObject;
472
+ public Account myAccountRecord;
473
+ }
474
+ ```
475
+
476
+ In this case `myObject` has a type of `Object`, and `myAccountRecord` is an SObject. Neither of these will be accurately
477
+ parsed when building the OpenApi definition, instead they will be simple be referenced as `object` without any properties.
478
+
479
+ To accurately represent the shape of these objects, you can use the `@http-schema` annotation to essentially override its
480
+ type during parsing. In this annotation you can specify the same thing you would in any `schema` property when dealing with any
481
+ of the main `@http-*` methods, meaning a reference to another class, or a Custom Schema (as defined below).
482
+
483
+ ```apex
484
+ public class MyClass {
485
+ /**
486
+ * @description This is a generic reference to another class
487
+ * @http-schema MyOtherClassName
488
+ */
489
+ public Object myObject;
490
+
491
+ /**
492
+ * @description This is a reference to an Account SObject
493
+ * @http-schema
494
+ * type: object
495
+ * properties:
496
+ * Id:
497
+ * type: string
498
+ * Name:
499
+ * type: string
500
+ * CustomField__c:
501
+ * type: number
502
+ */
503
+ public Account myAccountRecord;
504
+ }
505
+ ```
506
+
462
507
  ---
463
508
 
464
509
  If dealing with a collection, you can also specify the name of the reference either using the `List` or `Set` syntax.
@@ -472,16 +517,16 @@ Maps are not supported, as it is not possible to know which keys the map will co
472
517
  to convert that to a valid specification. For this use case, define a Custom Schema as explained below.
473
518
 
474
519
  ```apex
475
- /**
476
- * @description This is a sample HTTP Post method
477
- * @http-request-body
478
- * description: This is an example of a request body
479
- * schema: List<ClassName>
480
- */
481
- @HttpPost
482
- global static void doPost() {
483
- ///...
484
- }
520
+ /**
521
+ * @description This is a sample HTTP Post method
522
+ * @http-request-body
523
+ * description: This is an example of a request body
524
+ * schema: List<ClassName>
525
+ */
526
+ @HttpPost
527
+ global static void doPost() {
528
+ ///...
529
+ }
485
530
  ```
486
531
 
487
532
  Inner class references are also supported, but note that you need to pass the full name of the reference,
@@ -489,16 +534,16 @@ by using the `ParentClassName.InnerClassName` syntax, even if the inner class re
489
534
  referencing it.
490
535
 
491
536
  ```apex
492
- /**
493
- * @description This is a sample HTTP Post method
494
- * @http-request-body
495
- * description: This is an example of a request body
496
- * schema: ParentClass.InnerClass
497
- */
498
- @HttpPost
499
- global static void doPost() {
500
- ///...
501
- }
537
+ /**
538
+ * @description This is a sample HTTP Post method
539
+ * @http-request-body
540
+ * description: This is an example of a request body
541
+ * schema: ParentClass.InnerClass
542
+ */
543
+ @HttpPost
544
+ global static void doPost() {
545
+ ///...
546
+ }
502
547
  ```
503
548
 
504
549
  #### Custom Schemas
@@ -0,0 +1,10 @@
1
+ # nspc.GroupedClass
2
+
3
+ Uses a block style apex doc
4
+
5
+
6
+ **Group** Main
7
+
8
+
9
+ **Test Class** [nspc.SampleClass](/Main/nspc.SampleClass.md)
10
+
@@ -1,4 +1,4 @@
1
- # SampleClass
1
+ # nspc.SampleClass
2
2
 
3
3
  `NAMESPACEACCESSIBLE`
4
4
 
@@ -6,9 +6,9 @@
6
6
 
7
7
  `STATUS: ACTIVE`
8
8
 
9
- This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md)
9
+ This is a class description. This class relates to [nspc.SampleInterface](/Sample-Interfaces/nspc.SampleInterface.md)
10
10
  But this [ClassThatDoesNotExist](ClassThatDoesNotExist) does not exist.
11
- You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
11
+ You can also link using this syntax [nspc.SampleInterface](/Sample-Interfaces/nspc.SampleInterface.md)
12
12
 
13
13
 
14
14
  **Group** Main
@@ -20,7 +20,7 @@ This is a class description. This class relates to [SampleInterface](/Sample-Int
20
20
  **Author** Cesar Parra
21
21
 
22
22
 
23
- **See** [SampleInterface](/Sample-Interfaces/SampleInterface.md)
23
+ **See** [nspc.SampleInterface](/Sample-Interfaces/nspc.SampleInterface.md)
24
24
 
25
25
  ## Constructors
26
26
  ### My Super Group
@@ -28,7 +28,7 @@ This is a class description. This class relates to [SampleInterface](/Sample-Int
28
28
 
29
29
  `NAMESPACEACCESSIBLE`
30
30
 
31
- Constructs a SampleClass without any arguments. This relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md)
31
+ Constructs a SampleClass without any arguments. This relates to [nspc.SampleInterface](/Sample-Interfaces/nspc.SampleInterface.md)
32
32
 
33
33
  ###### Throws
34
34
 
@@ -40,7 +40,7 @@ Constructs a SampleClass without any arguments. This relates to [SampleInterface
40
40
  **CustomAnnotation** A Custom method annotation
41
41
 
42
42
 
43
- **See** [SampleInterface](/Sample-Interfaces/SampleInterface.md)
43
+ **See** [nspc.SampleInterface](/Sample-Interfaces/nspc.SampleInterface.md)
44
44
 
45
45
  ###### Example
46
46
  ```apex
@@ -0,0 +1 @@
1
+ # nspc.AnotherInterface
@@ -1,17 +1,17 @@
1
- # ChildClass
1
+ # nspc.ChildClass
2
2
 
3
3
  **Inheritance**
4
4
 
5
- [GrandparentClass](/Misc-Group/GrandparentClass.md)
5
+ [nspc.GrandparentClass](/Misc-Group/nspc.GrandparentClass.md)
6
6
  &gt;
7
- [ParentClass](/Misc-Group/ParentClass.md)
7
+ [nspc.ParentClass](/Misc-Group/nspc.ParentClass.md)
8
8
  &gt;
9
9
  ChildClass
10
10
 
11
11
 
12
12
  **Implemented types**
13
13
 
14
- [SampleInterface](/Sample-Interfaces/SampleInterface.md)
14
+ [nspc.SampleInterface](/Sample-Interfaces/nspc.SampleInterface.md)
15
15
 
16
16
  ## Fields
17
17
 
@@ -1,4 +1,4 @@
1
- # GrandparentClass
1
+ # nspc.GrandparentClass
2
2
  ## Fields
3
3
 
4
4
  ### `protectedGrandParentField` → `String`
@@ -1,10 +1,10 @@
1
- # InterfaceWithInheritance
1
+ # nspc.InterfaceWithInheritance
2
2
 
3
3
  **Extended types**
4
4
 
5
- [SampleInterface](/Sample-Interfaces/SampleInterface.md)
5
+ [nspc.SampleInterface](/Sample-Interfaces/nspc.SampleInterface.md)
6
6
  ,
7
- [AnotherInterface](/Misc-Group/AnotherInterface.md)
7
+ [nspc.AnotherInterface](/Misc-Group/nspc.AnotherInterface.md)
8
8
  ## Methods
9
9
  ### `execute()`
10
10
 
@@ -1,8 +1,8 @@
1
- # ParentClass
1
+ # nspc.ParentClass
2
2
 
3
3
  **Inheritance**
4
4
 
5
- [GrandparentClass](/Misc-Group/GrandparentClass.md)
5
+ [nspc.GrandparentClass](/Misc-Group/nspc.GrandparentClass.md)
6
6
  &gt;
7
7
  ParentClass
8
8
 
@@ -1,4 +1,4 @@
1
- # Reference1
1
+ # nspc.Reference1
2
2
  ## Fields
3
3
 
4
4
  ### `reference2Member` → `Reference2`
@@ -0,0 +1,12 @@
1
+ # nspc.Reference2
2
+ ## Fields
3
+
4
+ ### `objectReference` → `Object`
5
+
6
+
7
+ This is an object reference.
8
+
9
+ ### `stringMember` → `String`
10
+
11
+
12
+ ---
@@ -1,4 +1,4 @@
1
- # Reference3
1
+ # nspc.Reference3
2
2
  ## Fields
3
3
 
4
4
  ### `someBoolean` → `Boolean`
@@ -1,4 +1,4 @@
1
- # Reference4
1
+ # nspc.Reference4
2
2
  ## Fields
3
3
 
4
4
  ### `someString` → `String`
@@ -1,4 +1,4 @@
1
- # Reference5
1
+ # nspc.Reference5
2
2
  ## Fields
3
3
 
4
4
  ### `reference6Member` → `Reference6`
@@ -1,4 +1,4 @@
1
- # Reference6
1
+ # nspc.Reference6
2
2
  ## Fields
3
3
 
4
4
  ### `grandChildString` → `String`
@@ -1,4 +1,4 @@
1
- # SampleClassWithoutModifier
1
+ # nspc.SampleClassWithoutModifier
2
2
 
3
3
  `ISTEST`
4
4
  ## Methods
@@ -1,4 +1,4 @@
1
- # SampleRestResource
1
+ # nspc.SampleRestResource
2
2
 
3
3
  `RESTRESOURCE`
4
4
 
@@ -1,4 +1,4 @@
1
- # SampleRestResourceWithInnerClass
1
+ # nspc.SampleRestResourceWithInnerClass
2
2
 
3
3
  `RESTRESOURCE`
4
4
 
package/docs/README.md CHANGED
@@ -1,71 +1,71 @@
1
1
  # Classes
2
2
  ## Misc Group
3
3
 
4
- ### [AnotherInterface](/Misc-Group/AnotherInterface.md)
4
+ ### [nspc.AnotherInterface](/Misc-Group/nspc.AnotherInterface.md)
5
5
 
6
6
 
7
- ### [ChildClass](/Misc-Group/ChildClass.md)
7
+ ### [nspc.ChildClass](/Misc-Group/nspc.ChildClass.md)
8
8
 
9
9
 
10
- ### [GrandparentClass](/Misc-Group/GrandparentClass.md)
10
+ ### [nspc.GrandparentClass](/Misc-Group/nspc.GrandparentClass.md)
11
11
 
12
12
 
13
- ### [InterfaceWithInheritance](/Misc-Group/InterfaceWithInheritance.md)
13
+ ### [nspc.InterfaceWithInheritance](/Misc-Group/nspc.InterfaceWithInheritance.md)
14
14
 
15
15
 
16
- ### [ParentClass](/Misc-Group/ParentClass.md)
16
+ ### [nspc.ParentClass](/Misc-Group/nspc.ParentClass.md)
17
17
 
18
18
 
19
- ### [Reference1](/Misc-Group/Reference1.md)
19
+ ### [nspc.Reference1](/Misc-Group/nspc.Reference1.md)
20
20
 
21
21
 
22
- ### [Reference2](/Misc-Group/Reference2.md)
22
+ ### [nspc.Reference2](/Misc-Group/nspc.Reference2.md)
23
23
 
24
24
 
25
- ### [Reference3](/Misc-Group/Reference3.md)
25
+ ### [nspc.Reference3](/Misc-Group/nspc.Reference3.md)
26
26
 
27
27
 
28
- ### [Reference4](/Misc-Group/Reference4.md)
28
+ ### [nspc.Reference4](/Misc-Group/nspc.Reference4.md)
29
29
 
30
30
 
31
- ### [Reference5](/Misc-Group/Reference5.md)
31
+ ### [nspc.Reference5](/Misc-Group/nspc.Reference5.md)
32
32
 
33
33
 
34
- ### [Reference6](/Misc-Group/Reference6.md)
34
+ ### [nspc.Reference6](/Misc-Group/nspc.Reference6.md)
35
35
 
36
36
 
37
- ### [SampleClassWithoutModifier](/Misc-Group/SampleClassWithoutModifier.md)
37
+ ### [nspc.SampleClassWithoutModifier](/Misc-Group/nspc.SampleClassWithoutModifier.md)
38
38
 
39
39
 
40
- ### [SampleRestResource](/Misc-Group/SampleRestResource.md)
40
+ ### [nspc.SampleRestResource](/Misc-Group/nspc.SampleRestResource.md)
41
41
 
42
42
  Account related operations
43
43
 
44
44
 
45
45
 
46
- ### [SampleRestResourceWithInnerClass](/Misc-Group/SampleRestResourceWithInnerClass.md)
46
+ ### [nspc.SampleRestResourceWithInnerClass](/Misc-Group/nspc.SampleRestResourceWithInnerClass.md)
47
47
 
48
48
  Contact related operations
49
49
 
50
50
 
51
51
  ## Main
52
52
 
53
- ### [GroupedClass](/Main/GroupedClass.md)
53
+ ### [nspc.GroupedClass](/Main/nspc.GroupedClass.md)
54
54
 
55
55
  Uses a block style apex doc
56
56
 
57
57
 
58
58
 
59
- ### [SampleClass](/Main/SampleClass.md)
59
+ ### [nspc.SampleClass](/Main/nspc.SampleClass.md)
60
60
 
61
- This is a class description. This class relates to [SampleInterface](/Sample-Interfaces/SampleInterface.md)
61
+ This is a class description. This class relates to [nspc.SampleInterface](/Sample-Interfaces/nspc.SampleInterface.md)
62
62
  But this [ClassThatDoesNotExist](ClassThatDoesNotExist) does not exist.
63
- You can also link using this syntax [SampleInterface](/Sample-Interfaces/SampleInterface.md)
63
+ You can also link using this syntax [nspc.SampleInterface](/Sample-Interfaces/nspc.SampleInterface.md)
64
64
 
65
65
 
66
66
  ## Sample Interfaces
67
67
 
68
- ### [SampleInterface](/Sample-Interfaces/SampleInterface.md)
68
+ ### [nspc.SampleInterface](/Sample-Interfaces/nspc.SampleInterface.md)
69
69
 
70
70
  This is an interface description.
71
71
 
@@ -1,4 +1,4 @@
1
- # SampleInterface
1
+ # nspc.SampleInterface
2
2
 
3
3
  This is an interface description.
4
4
 
package/docs/index.html CHANGED
@@ -1,22 +1,22 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Document</title>
6
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7
- <meta name="description" content="Description">
8
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
9
- <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
10
- </head>
11
- <body>
12
- <div id="app"></div>
13
- <script>
14
- window.$docsify = {
15
- name: '',
16
- repo: ''
17
- }
18
- </script>
19
- <!-- Docsify v4 -->
20
- <script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
21
- </body>
22
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Document</title>
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7
+ <meta name="description" content="Description">
8
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
9
+ <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
10
+ </head>
11
+ <body>
12
+ <div id="app"></div>
13
+ <script>
14
+ window.$docsify = {
15
+ name: '',
16
+ repo: ''
17
+ }
18
+ </script>
19
+ <!-- Docsify v4 -->
20
+ <script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
21
+ </body>
22
+ </html>
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
- "title": "My REST Api 2",
4
+ "title": "Sample REST Api",
5
5
  "version": "1.0.0"
6
6
  },
7
7
  "servers": [
8
8
  {
9
- "url": "/services/apexrest/"
9
+ "url": "/services/apexrest/nspc/"
10
10
  }
11
11
  ],
12
12
  "paths": {
@@ -253,17 +253,6 @@
253
253
  },
254
254
  "delete": {
255
255
  "description": "Sample HTTP Delete method with references to other types.",
256
- "requestBody": {
257
- "description": "This is an example of a request body",
258
- "content": {
259
- "application/json": {
260
- "schema": {
261
- "$ref": "#/components/schemas/SampleClass"
262
- }
263
- }
264
- },
265
- "required": true
266
- },
267
256
  "parameters": [
268
257
  {
269
258
  "name": "limit",
@@ -419,9 +408,19 @@
419
408
  "properties": {
420
409
  "stringMember": {
421
410
  "type": "string"
411
+ },
412
+ "objectReference": {
413
+ "$ref": "#/components/schemas/Reference3_array",
414
+ "description": "This is an object reference."
422
415
  }
423
416
  }
424
417
  },
418
+ "Reference3_array": {
419
+ "type": "array",
420
+ "items": {
421
+ "$ref": "#/components/schemas/Reference3"
422
+ }
423
+ },
425
424
  "Reference3": {
426
425
  "type": "object",
427
426
  "properties": {
@@ -5,10 +5,6 @@
5
5
  global with sharing class SampleRestResource {
6
6
  /**
7
7
  * @description Sample HTTP Delete method with references to other types.
8
- * @http-request-body
9
- * description: This is an example of a request body
10
- * required: true
11
- * schema: SampleClass
12
8
  * @http-parameter
13
9
  * name: limit
14
10
  * in: header
@@ -1,3 +1,9 @@
1
1
  public class Reference2 {
2
2
  public String stringMember;
3
+
4
+ /**
5
+ * @description This is an object reference.
6
+ * @http-schema List<Reference3>
7
+ */
8
+ public Object objectReference;
3
9
  }
@@ -62,6 +62,16 @@ const argv = yargs.options({
62
62
  default: 'Apex REST Api',
63
63
  describe: 'If using "openapi" as the target generator, this allows you to specify the OpenApi title value.',
64
64
  },
65
+ namespace: {
66
+ type: 'string',
67
+ describe: 'The package namespace, if any. If this value is provided the namespace will be added as a prefix to all of the parsed files. ' +
68
+ "If generating an OpenApi definition, it will be added to the file's Server Url.",
69
+ },
70
+ openApiFileName: {
71
+ type: 'string',
72
+ describe: 'If using "openapi" as the target generator, this allows you to specify the name of the output file.',
73
+ default: 'openapi',
74
+ },
65
75
  }).argv;
66
76
  settings_1.Settings.build({
67
77
  sourceDirectory: argv.sourceDir,
@@ -73,6 +83,8 @@ settings_1.Settings.build({
73
83
  defaultGroupName: argv.defaultGroupName,
74
84
  sanitizeHtml: argv.sanitizeHtml,
75
85
  openApiTitle: argv.openApiTitle,
86
+ namespace: argv.namespace,
87
+ openApiFileName: argv.openApiFileName,
76
88
  });
77
89
  Apexdocs_1.Apexdocs.generate();
78
90
  //# sourceMappingURL=generate.js.map