Giter Site home page Giter Site logo

Comments (4)

Captain-P-Goldfish avatar Captain-P-Goldfish commented on August 11, 2024

Hi,
the way of overriding the user schema easier to understand in my eyes. If another developer looks into your code in two years it might be easier to understand that a custom schema is used if you copy and modify it. That is why I was suggesting doing so. Removing the attributes during runtime should also work though. Could you please explain the behaviour that you are experiencing?
It should be possible to remove attributes directly from the de.captaingoldfish.scim.sdk.common.schemas.Schema class and the change should take effect immediately.

from scim-sdk.

petersondrew avatar petersondrew commented on August 11, 2024

Hmm, I was using getMainSchema of the User resource type I had registered, and when I would call removeAttribute, the attribute would still appear when calling the /Schema endpoint.

I understand your suggestion on copying and modifying, I was concerned that maintainers might be confused by the User resource in the library compared to the custom OtherUser resource we'd be maintaining ourselves, so that's why I was experimenting with the runtime modifications.

from scim-sdk.

Captain-P-Goldfish avatar Captain-P-Goldfish commented on August 11, 2024

I was just trying the following:

    ResourceType userResourceType = resourceEndpoint.registerEndpoint(new UserEndpointDefinition(new UserHandler()));
    userResourceType.setFeatures(ResourceTypeFeatures.builder().autoFiltering(true).autoSorting(true).build());

    Schema mainSchema = userResourceType.getMainSchema();
    SchemaAttribute ims = mainSchema.getSchemaAttribute(AttributeNames.RFC7643.IMS);

and the /Schemas-Endpoint was no longer returning the ims -attribute. I you found a problem that causes the Schemas endpoint to return erroneous values please let me know but currently I cannot reproduce this problem.

I think this is also a perfectly fine and valid way of doing this if properly documented :-)

from scim-sdk.

petersondrew avatar petersondrew commented on August 11, 2024

This was definitely my misunderstanding of the API. I was using remove and passing a property name that likely was not one of the constant values. Your example above cleared everything up, thanks so much!

from scim-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.