forked from 1Password/typeshare
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request 1Password#173 from darrell-roberts/swift-decorator…
…s-generics Allow swift decorator constraints to apply to generics Support CSharp Create basic language implementation. Start adding tests. Add snapshot tests Update slice type to map to IEnumerable instead of Array. Drop support for Unit type and return an error. Support anonymous structs Update slice of user type test snapshot Support namespace option Support serialization with json attributes Remove EnumLabel and use EnumMember attribute instead. Update all test snapshots according to the new changes. C# without naming convention option Add required attribute For newtonsoft json to require a non optional property, the property has to have the required attribute. Otherwise, it allows it to be null and a default value is provided.
- Loading branch information
Showing
28 changed files
with
599 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#![cfg(feature = "online")] | ||
#![allow(dead_code)] | ||
|
||
use std::collection::HashMap; | ||
|
||
#[typeshare] | ||
pub enum TestEnum { | ||
Variant1, | ||
#[cfg(target_os = "ios")] | ||
Variant2, | ||
#[cfg(any(target_os = "ios", feature = "test"))] | ||
Variant3, | ||
#[cfg(all(target_os = "ios", feature = "test"))] | ||
Variant4, | ||
#[cfg(target_os = "android")] | ||
Variant5, | ||
} | ||
|
||
#[typeshare] | ||
#[cfg(target_os = "ios")] | ||
pub struct TestStruct; | ||
|
||
#[typeshare] | ||
#[cfg(target_os = "ios")] | ||
type TypeAlias = String; | ||
|
||
#[typeshare] | ||
#[cfg(any(target_os = "ios", feature = "test"))] | ||
pub enum Test {} | ||
|
||
#[typeshare] | ||
#[cfg(feature = "super")] | ||
#[cfg(target_os = "android")] | ||
pub enum SomeEnum {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package proto | ||
|
||
import "encoding/json" | ||
|
||
type TestEnum string | ||
const ( | ||
TestEnumVariant1 TestEnum = "Variant1" | ||
TestEnumVariant5 TestEnum = "Variant5" | ||
) | ||
type SomeEnum string | ||
const ( | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.agilebits.onepassword | ||
|
||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.SerialName | ||
|
||
@Serializable | ||
enum class TestEnum(val string: String) { | ||
@SerialName("Variant1") | ||
Variant1("Variant1"), | ||
@SerialName("Variant5") | ||
Variant5("Variant5"), | ||
} | ||
|
||
@Serializable | ||
enum class SomeEnum(val string: String) { | ||
} | ||
|
Oops, something went wrong.