@@ -344,7 +344,7 @@ apexdocs-generate -s ./src -t docs -g openapi --openApiTitle "Custom OpenApi Tit
344
344
345
345
### How It Works
346
346
347
- When generating an OpenApi document, since ` @RestResource ` need to be global in Apex, the ` --scope ` parameter will be ignored.
347
+ When generating an OpenApi document, since ` @RestResource ` classes need to be global in Apex, the ` --scope ` parameter will be ignored.
348
348
Instead, ApexDocs will run through all classes annotated with ` @RestResource ` and add it to the output OpenApi file.
349
349
350
350
Once it finishes running, a file named ` openapi.json ` will be created in the specified ` --targetDir ` .
@@ -363,7 +363,7 @@ some custom annotations that are specific to generating OpenApi definitions:
363
363
364
364
#### @http-request-body
365
365
366
- Allows you to specify the HTTP Request 's expected Request Body . It supports receiving a ` description ` ,
366
+ Allows you to specify the HTTP request 's expected request body . It supports receiving a ` description ` ,
367
367
whether it is ` required ` or not, and a ` schema ` , which defines the shape of the object that is expected.
368
368
369
369
📝 Note that only one ` @http-request-body ` should be defined per method. If you add more than one, only
@@ -380,6 +380,7 @@ Example
380
380
* description: This is an example of a request body
381
381
* required: true
382
382
* schema: ClassName
383
+ */
383
384
@HttpPost
384
385
global static void doPost() {
385
386
///...
@@ -476,21 +477,24 @@ to convert that to a valid specification. For this use case, define a Custom Sch
476
477
* @http-request-body
477
478
* description: This is an example of a request body
478
479
* schema: List<ClassName>
480
+ */
479
481
@HttpPost
480
482
global static void doPost() {
481
483
///...
482
484
}
483
485
```
484
486
485
487
Inner class references are also supported, but note that you need to pass the full name of the reference,
486
- by using the ` ParentClassName.InnerClassName ` syntax.
488
+ by using the ` ParentClassName.InnerClassName ` syntax, even if the inner class resides on the same class as the HTTP method
489
+ referencing it.
487
490
488
491
``` apex
489
492
/**
490
493
* @description This is a sample HTTP Post method
491
494
* @http-request-body
492
495
* description: This is an example of a request body
493
496
* schema: ParentClass.InnerClass
497
+ */
494
498
@HttpPost
495
499
global static void doPost() {
496
500
///...
0 commit comments