Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add json serialisation support for golang #1848

Merged
merged 13 commits into from
Mar 7, 2024
Prev Previous commit
Next Next commit
chore: fix option name
  • Loading branch information
Souvikns committed Mar 1, 2024
commit ce2a0c80c0c43000b9c7e4fa41146c23303977d6
4 changes: 2 additions & 2 deletions src/generators/go/presets/CommonPreset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ConstrainedEnumModel
} from '../../../models';

export interface GoCommonPresetOption {
export interface GoCommonPresetOptions {
addJsonTag: boolean;
}

Expand Down Expand Up @@ -48,7 +48,7 @@ function renderMarshallingFunctions({
`;
}

export const GO_COMMON_PRESET: GoPreset<GoCommonPresetOption> = {
export const GO_COMMON_PRESET: GoPreset<GoCommonPresetOptions> = {
struct: {
field: ({ content, field, options }) => {
const blocks: string[] = [];
Expand Down
21 changes: 13 additions & 8 deletions test/generators/go/presets/CommonPreset.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import {GoGenerator, GO_COMMON_PRESET, GoCommonPresetOption} from '../../../../src/generators'

import {
GoGenerator,
GO_COMMON_PRESET,
GoCommonPresetOptions
} from '../../../../src/generators';

describe('Go_COMMON_PRESET', () => {
let generator: GoGenerator
beforeEach(() => {
generator = new GoGenerator({presets: [GO_COMMON_PRESET]})
})
test('')
})
let generator: GoGenerator;
beforeEach(() => {
generator = new GoGenerator({
presets: [{ preset: GO_COMMON_PRESET, options: { addJsonTag: true } }]
Souvikns marked this conversation as resolved.
Show resolved Hide resolved
});
});
test('');
});
Loading