Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6d62e79
Add support for DateTime field for Go, JS, Python and keep the origin…
MOmarMiraj Mar 12, 2025
66bfad1
fmt fix
MOmarMiraj Mar 12, 2025
916ef7b
remove diff for kotlin
MOmarMiraj Mar 12, 2025
05ea27e
remove unused error and add TODOs for the languages that we don't add…
MOmarMiraj Mar 12, 2025
def0131
add todo
MOmarMiraj Mar 12, 2025
4e9246f
change to OffSetDateTime
MOmarMiraj Mar 12, 2025
f9f3ca4
add test cases for datetime and add errors for Datetime for unsupport…
MOmarMiraj Mar 12, 2025
eddbf9a
fix python serialization logic
MOmarMiraj Mar 12, 2025
4ee40f5
Merge branch 'main' into omar/34/add-date-time-support
MOmarMiraj Mar 12, 2025
a7accd9
update typescript update
MOmarMiraj Mar 12, 2025
5b474d6
add key as a match for TS
MOmarMiraj Mar 12, 2025
fc673a8
clean up code a bit
MOmarMiraj Mar 12, 2025
529be9c
add capability to add imports in go as well as address nits in python…
MOmarMiraj Mar 14, 2025
b4d5d3f
fix go imports and typescript spacing
MOmarMiraj Mar 14, 2025
e1a2b92
update imports to be tabs and sort them
MOmarMiraj Mar 14, 2025
ad45688
update expected tests
MOmarMiraj Mar 14, 2025
8371b66
ensure the custom translations are determnistic by sorting them
MOmarMiraj Mar 14, 2025
7a74614
fmt fix
MOmarMiraj Mar 14, 2025
9e39854
update typescript regex to include optional seconds as well as fix go…
MOmarMiraj Mar 14, 2025
82b5ece
add new line after single imports
MOmarMiraj Mar 14, 2025
2ef4d4a
change write import to add import
MOmarMiraj Mar 14, 2025
646f8f2
fix chaining and check if value is string instead of type casting it
MOmarMiraj Mar 14, 2025
2c7717e
ensure custom serialization/deserialzation is determinstic
MOmarMiraj Mar 14, 2025
5056f25
make go imports deterministic and add all numbers for python serializ…
MOmarMiraj Mar 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/data/tests/anonymous_struct_with_rename/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// Generated type representing the anonymous struct variant `List` of the `AnonymousStructWithRename` Rust enum
type AnonymousStructWithRenameListInner struct {
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_apply_prefix_correctly/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type ItemDetailsFieldValue struct {
Hello string `json:"hello"`
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_generate_algebraic_enum/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// Struct comment
type ItemDetailsFieldValue struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type SomeEnumTypes string
const (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// Generated type representing the anonymous struct variant `Us` of the `AutofilledBy` Rust enum
type AutofilledByUsInner struct {
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_generate_bare_string_enum/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// This is a comment.
type Colors string
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_generate_const/output.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

const MyVar uint32 = 12
4 changes: 3 additions & 1 deletion core/data/tests/can_generate_empty_algebraic_enum/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type AddressDetails struct {
}
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_generate_simple_enum/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// This is a comment.
// Continued lovingly here
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type Location struct {
}
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_generate_slice_of_user_type/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type Video struct {
Tags []Tag `json:"tags"`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type MyStruct struct {
A int `json:"a"`
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_generate_unit_structs/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type UnitStruct struct {
}
4 changes: 3 additions & 1 deletion core/data/tests/can_handle_anonymous_struct/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// Generated type representing the anonymous struct variant `Us` of the `AutofilledBy` Rust enum
type AutofilledByUsInner struct {
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_handle_quote_in_serde_rename/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// This is a comment.
type Colors string
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_handle_serde_rename/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type OtherType struct {
}
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_handle_serde_rename_all/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// This is a Person struct with camelCase rename
type Person struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type OtherType struct {
}
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_handle_unit_type/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// This struct has a unit field
type StructHasVoidType struct {
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_override_types/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type OverrideStruct struct {
FieldToOverride uint `json:"fieldToOverride"`
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/can_recognize_types_inside_modules/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type A struct {
Field uint32 `json:"field"`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// This is a comment.
// Continued lovingly here
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/excluded_by_target_os/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// A struct with no target_os. Should be generated when
// we use --target-os.
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/generate_types/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type CustomType struct {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type MyEmptyStruct struct {
}
4 changes: 3 additions & 1 deletion core/data/tests/kebab_case_rename/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// This is a comment.
type Things struct {
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/orders_types/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type A struct {
Field uint32 `json:"field"`
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/recursive_enum_decorator/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// Generated type representing the anonymous struct variant `Exactly` of the `MoreOptions` Rust enum
type MoreOptionsExactlyInner struct {
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/resolves_qualified_type/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type QualifiedTypes struct {
Unqualified string `json:"unqualified"`
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/serde_rename_references/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type AliasTest []SomethingFoo

Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/serialize_anonymous_field_as/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type SomeEnumTypes string
const (
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/serialize_field_as/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type EditItemViewModelSaveRequest struct {
Context string `json:"context"`
Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/serialize_type_alias/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type Uuid string

Expand Down
4 changes: 3 additions & 1 deletion core/data/tests/smart_pointers/output.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

// This is a comment.
type ArcyColors struct {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package proto

import "encoding/json"
import (
"encoding/json"
)

type ItemDetailsFieldValue struct {
}
Expand Down
6 changes: 0 additions & 6 deletions core/data/tests/test_byte_translation/input.rs

This file was deleted.

8 changes: 0 additions & 8 deletions core/data/tests/test_byte_translation/output.go

This file was deleted.

24 changes: 0 additions & 24 deletions core/data/tests/test_byte_translation/output.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#[typeshare]
#[serde(rename_all = "camelCase")]
pub struct Foo {
pub time: time::OffsetDateTime,
pub time2: time::OffsetDateTime,
pub time3: time::OffsetDateTime,
pub bytes: Vec<u8>,
pub bytes2: Vec<u8>
}
Loading
Loading