Skip to content

Attribute unavailable & available if request #1539

Closed
@patcharees

Description

@patcharees

SUMMARY

If it is possible to make some attributes unavailable by default and vice versa if specify explicitly in the request?

DETAILS

I am working with a data collection in mongodb that is complex and contains many nested data structure (inside its own collection).
I wonder if it is possible to define some [attr ?] attribute that make view of nested data structure unavailable by default, and vice versa if specify explicitly in the request somehow?

STEPS TO REPRODUCE

  1. Here is my resource class. Now all Refs1, Refs2, Refs3 publicly available. How can I define here to give me the behaviours I described? Is it possible?
public class Resource1 : Identifiable<string>
{

[Attr]
public string? id { get; set; }

[Attr]
public string? name { get; set; }

[Attr]
public List<Ref1>? Refs1 { get; set; }

[Attr]
public List<Ref2>? Refs2 { get; set; }

[Attr]
public List<Ref3>? Refs3 { get; set; }

}

VERSIONS USED

  • JsonApiDotNetCore version: 4,2.0
  • ASP.NET Core version: 6.0
  • Entity Framework Core version:
  • Database provider: mongodb

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions