Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add some comment to explain this more
  • Loading branch information
ArcturusZhang committed Aug 2, 2021
commit ecf713fa862d7d23a52dbb2be54e37b06946011b
6 changes: 4 additions & 2 deletions specification/compute/resource-manager/readme.go.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ go:
clear-output-folder: true

directive:
# dynamically add a DummyOrchestrationServiceName value to the enum to avoid the generator generates the code by hard-coding the single entried enum value
# dynamically add a DummyOrchestrationServiceName value to the enum and then remove it from the generated code to avoid the generator generates the code by hard-coding the single-entry enum value
# this directive adds a DummyOrchestrationServiceName to the enum type
- from: compute.json
where: $..enum
transform: >-
Expand All @@ -17,6 +18,7 @@ directive:
}
return $;

# this directive removes the DummyOrchestrationServiceName from the generated code, so that we still have only one enum entry in this enum type.
- from: source-file-go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we don't need this any more for track 1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need this anymore. Once the enum entry was added into the modeler, the generator can handle it properly. We do not need replace the generated code anymore.

where: $
transform: >-
Expand All @@ -35,7 +37,7 @@ output-folder: $(go-sdk-folder)/$(module-name)
azure-arm: true

directive:
# we do not need to hack to add a dummy enum entry in track 2
# we do not need to hack to add a dummy enum entry in track 2, because track 2 generator will generate the enum type even if it only has on entry
- from: disk.json
where: "$.definitions.PurchasePlan"
transform: >
Expand Down