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

[JsonIgnore] Property Ignored in nested Classes #34

Open
StefanKern opened this issue Aug 16, 2017 · 0 comments
Open

[JsonIgnore] Property Ignored in nested Classes #34

StefanKern opened this issue Aug 16, 2017 · 0 comments

Comments

@StefanKern
Copy link

StefanKern commented Aug 16, 2017

Installed product versions

  • Visual Studio 2017 Community
  • Version: 1.1.24

Description

The [JsonIgnore] on an argument is ignored when the property is nested in another class

Steps to recreate

Classes:

public class Class1
{
    public Class2 Prop{ get; set; }
 }
public class Class2
{
    public int Prop { get; set; }
    [JsonIgnore]
    public int JsonIgnoreProp{ get; set; }
 }

Current behavior

The plugin generates a result which ignores the class nesting and the [JsonIgnore]

declare module server {
	interface class1 {
		prop: {
			prop: number;
			jsonIgnoreProp: number;
		};
	}
	interface class2 {
		prop: number;
	}
}

Expected behavior

The plugin should generate a interface which takes the class2 interlace and accounts for the [JsonIgnore] property (well class2 is tactfully generated correctly, so if it takes the correct type, it would be fine).

declare module server {
	interface class1 {
		prop: class2;
	}
	interface class2 {
		prop: number;
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant