azure-service-operator icon indicating copy to clipboard operation
azure-service-operator copied to clipboard

Use Swagger as sole input

Open Porges opened this issue 3 years ago • 2 comments
trafficstars

nothing to see here, WIP


Changes

Note that this time around I reduced scope to try to do the minimal amount to change over to Swagger-only. We can always improve the naming conventions in a fresh PR.

Naming changes

  • Now allow _ in names. This is contra established Golang guidelines, but they don't appear in CRDs and being able to separate names makes a significant difference in readability when we generate long names due to multiple layers of unnamed nested objects. This also avoids generating clashes when RP Swagger uses _ in some types.
  • Use _ to separate enum name from enum value in enum value identifiers. (e.g. SkuName_Standard_LRS)
  • Use _STATUS as status-type suffix to avoid generating collisions with _Status names that are generated due to properties etc.
  • When generating names based upon _STATUS names, ensure that the suffix is kept at the end of the name, instead of being embedded when adding more parts onto the end.
  • Spec types are now correctly singularized, matching the resource type.

Improvements

  • Location property disappears from several places that it was not needed. (RoleAssignment, global MariaDB, …)
  • Some other properties that were documented as "doing nothing" have disappeared.
  • Most names have gotten better, a few have gotten worse. VirtualMachineScaleSets_Spec_Properties_VirtualMachineProfile_NetworkProfile_NetworkInterfaceConfigurations_Properties_IpConfigurations is now VirtualMachineScaleSetIPConfiguration

Remaining work

  • [x] add Id property to all status types (?)
  • [x] figure out why extension types aren't triggering/working properly
  • [ ] restore cross-resource-references functionality
  • [ ] review all donotmerge, including config file

Porges avatar May 26 '22 23:05 Porges

Getting close now, a few compilation errors in tests.

Porges avatar May 30 '22 22:05 Porges

Currently stuck awaiting a workaround for go compiler bug... 🤦

Porges avatar Jun 06 '22 22:06 Porges