File tree Expand file tree Collapse file tree 1 file changed +39
-2
lines changed Expand file tree Collapse file tree 1 file changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -531,11 +531,48 @@ If plugins are used, additional traversal is currently needed.
531
531
532
532
#### Generate stage
533
533
534
- We can currently only generate JSON documents from the ApiDOM structure.
534
+ We can generate JSON/YAML documents from the ApiDOM structure.
535
535
It doesn't matter if the original document was originally defined in JSON or YAML.
536
- Generated JSON documented will have exactly the same semantic information as the original one,
536
+ Generated JSON/YAML documented will have exactly the same semantic information as the original one,
537
537
but the style information from the original document is not preserved (white spaces/comments, etc..).
538
538
539
+ ``` mermaid
540
+ flowchart TD
541
+ %% Input node
542
+ In["JSON/YAML string"]
543
+
544
+ %%--- Parse Stage and internals
545
+ subgraph Parse_Stage["Parse Stage"]
546
+ P1["Lexical Analysis<br/>JSON/YAML → CST"]
547
+ SA["Syntactic Analysis"]
548
+ SA1["Direct<br/>*CST → Generic ApiDOM*"]
549
+ SA2["Indirect<br/>*CST → JSON AST → Generic ApiDOM*"]
550
+
551
+ P1 --> SA
552
+ SA --> SA1
553
+ SA --> SA2
554
+ end
555
+
556
+ %%--- Refract Stage
557
+ subgraph Refract_Stage["Refract Stage"]
558
+ R["Generic ApiDOM + plugins → Semantic ApiDOM"]
559
+ end
560
+
561
+ %%--- Generate Stage
562
+ subgraph Generate_Stage["Generate Stage"]
563
+ G["Generate JSON/YAML output<br/>(style info lost)"]
564
+ end
565
+
566
+ %% Output node
567
+ Out["JSON/YAML string"]
568
+
569
+ %%--- Connections
570
+ In --> Parse_Stage
571
+ Parse_Stage --> Refract_Stage
572
+ Refract_Stage --> Generate_Stage
573
+ Generate_Stage --> Out
574
+ ```
575
+
539
576
---
540
577
541
578
Having said that, this is how JSON OpenAPI 3.1 document gets transformed into ApiDOM:
You can’t perform that action at this time.
0 commit comments