question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not hide property

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
iSeiryucommented, Mar 12, 2021

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. With ISchemaFilter there are simply no properties to act on - SchemaFilterContext.Properties is empty for such objects. IDocumentFilter does not contain definitions anymore.

internal, protected, and private work but the objects are generally accessed from other projects and/or from the unit tests.

2reactions
domaindrivendevcommented, Jun 12, 2018

Swashbuckle simply honors the built-in serialization behavior. If you try to serialize an instance of DerivedClass you will observe that the Foo 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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found