- 
                Notifications
    
You must be signed in to change notification settings  - Fork 6
 
chore: cleanup unnecessary JSON properties and annotations #242
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
chore: cleanup unnecessary JSON properties and annotations #242
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR cleans up the models by removing redundant @JsonIgnoreProperties annotations now that the global JSON configuration ignores unknown properties. It also updates several classes to Kotlin data classes for improved readability and consistency, and removes unused imports.
- Removed redundant JSON annotations from multiple model classes.
 - Converted regular classes to data classes.
 - Removed unused or unnecessary import statements.
 
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description | 
|---|---|
| Variable.kt | Removed unused JSON annotation and updated comment formatting. | 
| SSE.kt | Removed JSON annotation and converted class to a data class. | 
| ProjectSettings.kt | Removed JSON annotation and converted class to a data class. | 
| Project.kt | Removed JSON annotation and converted class to a data class. | 
| Feature.kt | Removed JSON annotation and converted class to a data class. | 
| ErrorResponse.kt | Removed JSON annotation and replaced with a wildcard import. | 
| Environment.kt | Removed JSON annotation, converted class to a data class, and reformatted code. | 
| EdgeDB.kt | Removed JSON annotation and converted class to a data class. | 
| DevCycleUser.kt | Removed JSON annotation from the Builder and converted class to a data class. | 
| ConfigVariable.kt | Removed JSON annotations from multiple variable classes. | 
| BucketedUserConfig.kt | Removed redundant JSON annotation. | 
        
          
                android-client-sdk/src/main/java/com/devcycle/sdk/android/model/ErrorResponse.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | * Feature | ||
| */ | ||
| class Feature { | ||
| data class Feature { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is interesting that this was missing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess do we want these to be data classes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I just made the same update in my PR #240. though it does need some refactoring to make sure everything compiles, the test data is updated and all test pass appropriately

The JSON parsing library was audited to ensure unknown properties are ignored globally.
JSONMapper.ktis configured withDeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIESset tofalse, which globally ignores unknown JSON properties during deserialization.@JsonIgnoreProperties(ignoreUnknown = true)annotations were removed from the following model classes:BucketedUserConfig.ktVariable.ktConfigVariable.kt(6 instances across abstract and concrete classes)SSE.ktProjectSettings.ktProject.ktFeature.ktErrorResponse.ktEnvironment.ktEdgeDB.ktDevCycleUser.ktimport com.fasterxml.jackson.annotation.JsonIgnorePropertiesstatements were also removed.@JsonProperty,@JsonInclude,@JsonFormat,@JsonDeserialize) were retained as they serve distinct, necessary purposes for serialization, formatting, and custom deserialization logic.