You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: ArgoCD v2.13.3 support for private chart providers (#6766)
* refactor: update chart handling and dependency management in GitOps operations
* refactor: improve chart metadata handling and error logging in GitOps operations
* refactor: add support for setting APIVersion in chart metadata
* refactor: convert requirements.yaml to JSON before unmarshalling in GitOps operations
* refactor: convert chart.yaml to JSON before unmarshalling in GitOps operations
* refactor: enhance dependency validation by using unique keys for comparison in GitOps operations
* refactor: convert chart metadata from JSON to YAML format for GitOps operations
* refactor: update shouldMigrateProxyChartDependencies to accept expected chart metadata and remove requirements.yaml checks
* docs: add developer guide for creating API specs and generating Go beans
* wip
---------
Co-authored-by: Ash-exp <asutosh2000ad@gmail.com>
Co-authored-by: ayushmaheshwari <ayush@devtron.ai>
Co-authored-by: iamayushm <32041961+iamayushm@users.noreply.github.com>
output: {{ // relative path to the generator.go file }}
47
+
```
48
+
---
49
+
50
+
## 3. Add go:generate Directive
51
+
- In your Go file (e.g., `generator.go`), add a `//go:generate` comment:
52
+
```go
53
+
//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen "--config=../../../../specs/bulkEdit/v1beta2/oapi-models-config.yaml" "../../../../specs/bulkEdit/v1beta2/bulk_edit.yaml"
54
+
```
55
+
- Here `--config` is the relative path (from the `generator.go` file) to your config file, i.e. `oapi-models-config.yaml` file.
56
+
- And the last argument is the path to your OpenAPI spec file, i.e. `bulk_edit.yaml`.
57
+
---
58
+
59
+
## 4. Generate the Beans
60
+
Run: (From the root dir)
61
+
```bash
62
+
go generate ./pkg/...
63
+
```
64
+
> This will generate Go structs at the path specified in your config (e.g., bean/bean.go).
65
+
---
66
+
67
+
## 5. Best Practices
68
+
Keep OpenAPI specs DRY: use $ref and shared schemas.
69
+
Document every field and endpoint.
70
+
Use validation tags for all struct fields.
71
+
Exclude error response types from bean generation if not needed.
72
+
Keep config and spec files versioned and close to your Go code.
73
+
---
74
+
75
+
## Summary:
76
+
Write your OpenAPI YAML, create a codegen config, add a go:generate directive, and run go generate to produce Go beans at the desired path.
77
+
Follow the structure in bulk_edit.yaml and oapi-models-config.yaml for consistency.
0 commit comments