Can not hide property
See original GitHub issueI can not hide a property from the UI.
I wanted do this because my API have some properties that are meant for private use as they are still under development and are to be undocumented and hidden until later when they become a part of the public API as they might change.
public class Model
{
[EditorBrowsable(EditorBrowsableState.Never)]
[Browsable(false)]
[HiddenInput]
[IgnoreDataMember]
[JsonIgnore]
public string Hidden { get; set; }
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Can't hide property or filed of base class using new keyword
@adelphus, The reason of using "new" is to set property or field of base class. "set" is not accessible as that is "internal"....
Read more >How to Hide Real Estate Ownership and Own Property ...
How to hide ownership of property and keep real estate transactions private. Use land trusts and privacy trusts to keep records anonymous.
Read more >How to hide property from displaying in Swagger? #1230
I have a property that I want to serialize but dont want it visible in Swagger. ... Can not hide property domaindrivendev/Swashbuckle.
Read more >new modifier - C# Reference
Although you can hide public or protected members without using the new modifier, you get a compiler warning. If you use new to...
Read more >How To Hide Your Real Estate From Lawsuits ... - YouTube
Show Notes: 0:00 Intro 1:05 Hiding Your Real Estate 4:26 Trusts 7:30 ... The information provided in this video should not be construed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/domaindrivendev/Swashbuckle/issues/178 https://github.com/domaindrivendev/Swashbuckle/issues/1230
Not a single solution posted here in the issues nor on stackoverflow work for the GET endpoints that use
[FromQuery]
binder. WithISchemaFilter
there are simply no properties to act on -SchemaFilterContext.Properties
is empty for such objects.IDocumentFilter
does not contain definitions anymore.internal
,protected
, andprivate
work but the objects are generally accessed from other projects and/or from the unit tests.Swashbuckle simply honors the built-in serialization behavior. If you try to serialize an instance of
DerivedClass
you will observe that theFoo
property is in fact outputted. Hence, Swashbuckle describes the behavior accurately.Now … the next question is why does the built-in serializer behave that way. Perhaps the response here from Mr Newton-King himself will provide some further insight - https://github.com/JamesNK/Newtonsoft.Json/issues/463