mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	feat: filter out all data fields other than explicit openapi fields (#3284)
Co-authored-by: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									f0bfa16ec2
								
							
						
					
					
						commit
						b05b075ac8
					
				@ -49,6 +49,7 @@ export const clientFeatureSchema = {
 | 
			
		||||
            items: {
 | 
			
		||||
                $ref: '#/components/schemas/featureStrategySchema',
 | 
			
		||||
            },
 | 
			
		||||
            deprecated: true,
 | 
			
		||||
        },
 | 
			
		||||
        variants: {
 | 
			
		||||
            type: 'array',
 | 
			
		||||
@ -56,6 +57,7 @@ export const clientFeatureSchema = {
 | 
			
		||||
                $ref: '#/components/schemas/variantSchema',
 | 
			
		||||
            },
 | 
			
		||||
            nullable: true,
 | 
			
		||||
            deprecated: true,
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
    components: {
 | 
			
		||||
 | 
			
		||||
@ -81,7 +81,7 @@ export default class FeatureController extends Controller {
 | 
			
		||||
                    operationId: 'getClientFeature',
 | 
			
		||||
                    tags: ['Client'],
 | 
			
		||||
                    responses: {
 | 
			
		||||
                        200: createResponseSchema('clientFeaturesSchema'),
 | 
			
		||||
                        200: createResponseSchema('clientFeatureSchema'),
 | 
			
		||||
                    },
 | 
			
		||||
                }),
 | 
			
		||||
            ],
 | 
			
		||||
 | 
			
		||||
@ -688,7 +688,37 @@ class FeatureToggleService {
 | 
			
		||||
        query?: IFeatureToggleQuery,
 | 
			
		||||
        includeIds?: boolean,
 | 
			
		||||
    ): Promise<FeatureConfigurationClient[]> {
 | 
			
		||||
        return this.featureToggleClientStore.getClient(query, includeIds);
 | 
			
		||||
        const result = await this.featureToggleClientStore.getClient(
 | 
			
		||||
            query,
 | 
			
		||||
            includeIds,
 | 
			
		||||
        );
 | 
			
		||||
        return result.map(
 | 
			
		||||
            ({
 | 
			
		||||
                name,
 | 
			
		||||
                type,
 | 
			
		||||
                enabled,
 | 
			
		||||
                project,
 | 
			
		||||
                stale,
 | 
			
		||||
                strategies,
 | 
			
		||||
                variants,
 | 
			
		||||
                description,
 | 
			
		||||
                createdAt,
 | 
			
		||||
                lastSeenAt,
 | 
			
		||||
                impressionData,
 | 
			
		||||
            }) => ({
 | 
			
		||||
                name,
 | 
			
		||||
                type,
 | 
			
		||||
                enabled,
 | 
			
		||||
                project,
 | 
			
		||||
                stale,
 | 
			
		||||
                strategies,
 | 
			
		||||
                variants,
 | 
			
		||||
                description,
 | 
			
		||||
                createdAt,
 | 
			
		||||
                lastSeenAt,
 | 
			
		||||
                impressionData,
 | 
			
		||||
            }),
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 | 
			
		||||
@ -489,6 +489,7 @@ exports[`should serve the OpenAPI spec 1`] = `
 | 
			
		||||
            "type": "boolean",
 | 
			
		||||
          },
 | 
			
		||||
          "strategies": {
 | 
			
		||||
            "deprecated": true,
 | 
			
		||||
            "items": {
 | 
			
		||||
              "$ref": "#/components/schemas/featureStrategySchema",
 | 
			
		||||
            },
 | 
			
		||||
@ -498,6 +499,7 @@ exports[`should serve the OpenAPI spec 1`] = `
 | 
			
		||||
            "type": "string",
 | 
			
		||||
          },
 | 
			
		||||
          "variants": {
 | 
			
		||||
            "deprecated": true,
 | 
			
		||||
            "items": {
 | 
			
		||||
              "$ref": "#/components/schemas/variantSchema",
 | 
			
		||||
            },
 | 
			
		||||
@ -8567,11 +8569,11 @@ If the provided project does not exist, the list of events will be empty.",
 | 
			
		||||
            "content": {
 | 
			
		||||
              "application/json": {
 | 
			
		||||
                "schema": {
 | 
			
		||||
                  "$ref": "#/components/schemas/clientFeaturesSchema",
 | 
			
		||||
                  "$ref": "#/components/schemas/clientFeatureSchema",
 | 
			
		||||
                },
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
            "description": "clientFeaturesSchema",
 | 
			
		||||
            "description": "clientFeatureSchema",
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        "tags": [
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user