Skip to content

Commit 9ea7c23

Browse files
committed
Revert "feat: fixed data tags, description preset for Go, add goIncludeComments and goIncludeTags flags (#2123)"
This reverts commit 8a06f1a.
1 parent 375fc05 commit 9ea7c23

File tree

25 files changed

+118
-451
lines changed

25 files changed

+118
-451
lines changed

docs/languages/Go.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@ There are special use-cases that each language supports; this document pertains
44
<!-- toc is generated with GitHub Actions do not remove toc markers -->
55
<!-- toc -->
66

7-
- [Go](#go)
8-
- [Generate serializer and deserializer functionality](#generate-serializer-and-deserializer-functionality)
9-
- [To and from JSON](#to-and-from-json)
10-
- [JSON Tags](#json-tags)
11-
- [To and from XML](#to-and-from-xml)
12-
- [To and from binary](#to-and-from-binary)
13-
- [Rendering comments from description and example fields](#rendering-comments-from-description-and-example-fields)
7+
- [Generate serializer and deserializer functionality](#generate-serializer-and-deserializer-functionality)
8+
* [To and from JSON](#to-and-from-json)
9+
* [To and from XML](#to-and-from-xml)
10+
* [To and from binary](#to-and-from-binary)
1411

1512
<!-- tocstop -->
1613

@@ -27,7 +24,7 @@ Here are all the supported presets and the libraries they use for converting to
2724

2825
#### JSON Tags
2926

30-
To generate go models that work correctly with JSON marshal functions we need to generate appropriate JSON `struct-tags`, use the preset `GO_COMMON_PRESET` and provide the option `addJsonTag: true` (added in CLI by default).
27+
To generate go models that work correctly with JSON marshal functions we need to generate appropriate JSON `struct-tags`, use the preset `GO_COMMON_PRESET` and provide the option `addJsonTag: true`.
3128

3229
check out this [example for a live demonstration](../../examples/go-json-tags/)
3330

@@ -36,9 +33,3 @@ Currently not supported, [let everyone know you need it](https://github.com/asyn
3633

3734
### To and from binary
3835
Currently not supported, [let everyone know you need it](https://github.com/asyncapi/modelina/issues/new?assignees=&labels=enhancement&template=enhancement.md)!
39-
40-
## Rendering comments from description and example fields
41-
42-
You can use the `GO_DESCRIPTION_PRESET` to generate comments from description fields in your model.
43-
44-
See [this example](../../examples/generate-go-asyncapi-comments) for how this can be used.

examples/generate-go-asyncapi-comments/README.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/generate-go-asyncapi-comments/__snapshots__/index.spec.ts.snap

Lines changed: 0 additions & 27 deletions
This file was deleted.

examples/generate-go-asyncapi-comments/index.spec.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

examples/generate-go-asyncapi-comments/index.ts

Lines changed: 0 additions & 116 deletions
This file was deleted.

examples/generate-go-asyncapi-comments/package-lock.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

examples/generate-go-asyncapi-comments/package.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/generate-go-enums/__snapshots__/index.spec.ts.snap

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
exports[`Should be able to render Go Enums and should log expected output to console 1`] = `
44
Array [
5-
"type Root struct {
5+
"// Root represents a Root model.
6+
type Root struct {
67
Cities *Cities
78
Options *Options
89
}",
@@ -11,7 +12,8 @@ Array [
1112

1213
exports[`Should be able to render Go Enums and should log expected output to console 2`] = `
1314
Array [
14-
"type Cities uint
15+
"// Cities represents an enum of Cities.
16+
type Cities uint
1517
1618
const (
1719
CitiesLondon Cities = iota
@@ -39,7 +41,8 @@ var ValuesToCities = map[any]Cities{
3941

4042
exports[`Should be able to render Go Enums and should log expected output to console 3`] = `
4143
Array [
42-
"type Options uint
44+
"// Options represents an enum of Options.
45+
type Options uint
4346
4447
const (
4548
OptionsNumber_123 Options = iota

examples/generate-go-models/__snapshots__/index.spec.ts.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
exports[`Should be able to render Go Models and should log expected output to console 1`] = `
44
Array [
5-
"type Root struct {
5+
"// Root represents a Root model.
6+
type Root struct {
67
Email string
78
}",
89
]

examples/go-json-tags/__snapshots__/index.spec.ts.snap

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
exports[`Should be able to render json-tags in struct and should log expected output to console 1`] = `
44
Array [
5-
"type Root struct {
5+
"// Root represents a Root model.
6+
type Root struct {
67
Cities *Cities \`json:\\"cities,omitempty\\"\`
78
Options *Options \`json:\\"options,omitempty\\"\`
89
}",
@@ -11,7 +12,8 @@ Array [
1112
1213
exports[`Should be able to render json-tags in struct and should log expected output to console 2`] = `
1314
Array [
14-
"type Cities uint
15+
"// Cities represents an enum of Cities.
16+
type Cities uint
1517
1618
const (
1719
CitiesLondon Cities = iota
@@ -52,7 +54,8 @@ func (op Cities) MarshalJSON() ([]byte, error) {
5254
5355
exports[`Should be able to render json-tags in struct and should log expected output to console 3`] = `
5456
Array [
55-
"type Options uint
57+
"// Options represents an enum of Options.
58+
type Options uint
5659
5760
const (
5861
OptionsNumber_123 Options = iota

0 commit comments

Comments
 (0)