Skip to content

Commit

Permalink
Merge branch 'next' into switch_cli_to_cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored Jun 3, 2024
2 parents e8a5a75 + 42c6505 commit 039b66a
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 27 deletions.
4 changes: 2 additions & 2 deletions examples/go-json-tags/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ exports[`Should be able to render json-tags in struct and should log expected ou
Array [
"// Root represents a Root model.
type Root struct {
Cities *Cities \`json:\\"cities, omitempty\\"\`
Options *Options \`json:\\"options, omitempty\\"\`
Cities *Cities \`json:\\"cities,omitempty\\"\`
Options *Options \`json:\\"options,omitempty\\"\`
}",
]
`;
Expand Down
22 changes: 11 additions & 11 deletions modelina-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ $ npm install -g @asyncapi/modelina-cli
$ modelina COMMAND
running command...
$ modelina (--version)
@asyncapi/modelina-cli/4.0.0-next.42 linux-x64 node-v18.20.2
@asyncapi/modelina-cli/4.0.0-next.44 linux-x64 node-v18.20.3
$ modelina --help [COMMAND]
USAGE
$ modelina COMMAND
Expand Down Expand Up @@ -204,7 +204,7 @@ DESCRIPTION
CLI config settings
```

_See code: [src/commands/config/index.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.42/modelina-cli/src/commands/config/index.ts)_
_See code: [src/commands/config/index.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/index.ts)_

## `modelina config context`

Expand All @@ -218,7 +218,7 @@ DESCRIPTION
Manage short aliases for full paths to inputs
```

_See code: [src/commands/config/context/index.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.42/modelina-cli/src/commands/config/context/index.ts)_
_See code: [src/commands/config/context/index.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/index.ts)_

## `modelina config context add CONTEXT-NAME SPEC-FILE-PATH`

Expand All @@ -240,7 +240,7 @@ DESCRIPTION
Add a context to the store
```

_See code: [src/commands/config/context/add.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.42/modelina-cli/src/commands/config/context/add.ts)_
_See code: [src/commands/config/context/add.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/add.ts)_

## `modelina config context current`

Expand All @@ -257,7 +257,7 @@ DESCRIPTION
Shows the current context that is being used
```

_See code: [src/commands/config/context/current.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.42/modelina-cli/src/commands/config/context/current.ts)_
_See code: [src/commands/config/context/current.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/current.ts)_

## `modelina config context edit CONTEXT-NAME NEW-SPEC-FILE-PATH`

Expand All @@ -278,7 +278,7 @@ DESCRIPTION
Edit a context in the store
```

_See code: [src/commands/config/context/edit.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.42/modelina-cli/src/commands/config/context/edit.ts)_
_See code: [src/commands/config/context/edit.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/edit.ts)_

## `modelina config context init [CONTEXT-FILE-PATH]`

Expand All @@ -301,7 +301,7 @@ DESCRIPTION
Initialize context
```

_See code: [src/commands/config/context/init.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.42/modelina-cli/src/commands/config/context/init.ts)_
_See code: [src/commands/config/context/init.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/init.ts)_

## `modelina config context list`

Expand All @@ -318,7 +318,7 @@ DESCRIPTION
List all the stored contexts in the store
```

_See code: [src/commands/config/context/list.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.42/modelina-cli/src/commands/config/context/list.ts)_
_See code: [src/commands/config/context/list.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/list.ts)_

## `modelina config context remove CONTEXT-NAME`

Expand All @@ -338,7 +338,7 @@ DESCRIPTION
Delete a context from the store
```

_See code: [src/commands/config/context/remove.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.42/modelina-cli/src/commands/config/context/remove.ts)_
_See code: [src/commands/config/context/remove.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/remove.ts)_

## `modelina config context use CONTEXT-NAME`

Expand All @@ -358,7 +358,7 @@ DESCRIPTION
Set a context as current
```

_See code: [src/commands/config/context/use.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.42/modelina-cli/src/commands/config/context/use.ts)_
_See code: [src/commands/config/context/use.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/config/context/use.ts)_

## `modelina generate LANGUAGE FILE`

Expand Down Expand Up @@ -416,5 +416,5 @@ DESCRIPTION
Generates typed models
```

_See code: [src/commands/generate.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.42/modelina-cli/src/commands/generate.ts)_
_See code: [src/commands/generate.ts](https://github.com/asyncapi/modelina/blob/v4.0.0-next.44/modelina-cli/src/commands/generate.ts)_
<!-- commandsstop -->
9 changes: 4 additions & 5 deletions modelina-cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modelina-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@asyncapi/modelina-cli",
"description": "CLI to work with Modelina",
"version": "4.0.0-next.43",
"version": "4.0.0-next.45",
"bin": {
"modelina": "./bin/run_bin"
},
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@asyncapi/modelina",
"version": "4.0.0-next.43",
"version": "4.0.0-next.45",
"description": "Library for generating data models based on inputs such as AsyncAPI, OpenAPI, or JSON Schema documents",
"license": "Apache-2.0",
"homepage": "https://www.modelina.org",
Expand Down
4 changes: 2 additions & 2 deletions src/generators/go/presets/CommonPreset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ function renderJSONTag({
field.property instanceof ConstrainedDictionaryModel &&
field.property.serializationType === 'unwrap'
) {
return `json:"-"`;
return `json:"-,omitempty"`;
}
return `json:"${field.unconstrainedPropertyName}, omitempty"`;
return `json:"${field.unconstrainedPropertyName},omitempty"`;
}

function renderMarshallingFunctions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
exports[`GO_COMMON_PRESET should render json tags for structs 1`] = `
"// Root represents a Root model.
type Root struct {
StringProp string \`json:\\"stringProp, omitempty\\"\`
NumberProp float64 \`json:\\"numberProp, omitempty\\"\`
BooleanProp bool \`json:\\"booleanProp, omitempty\\"\`
StringProp string \`json:\\"stringProp,omitempty\\"\`
NumberProp float64 \`json:\\"numberProp,omitempty\\"\`
BooleanProp bool \`json:\\"booleanProp,omitempty\\"\`
}"
`;
Expand Down

0 comments on commit 039b66a

Please sign in to comment.