Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7634636
wip: support nested attributes while creating schema
bhavanakarwade Mar 28, 2025
a593a2a
Merge branch 'develop' of https://github.com/credebl/platform into fe…
bhavanakarwade Mar 28, 2025
940b068
wip: aligned issuance functionality with nested attributes structure
bhavanakarwade Apr 3, 2025
df1aed1
Merge branch 'develop' of https://github.com/credebl/platform into fe…
bhavanakarwade Apr 3, 2025
5ce21fb
refactor: modify csv to json function
bhavanakarwade Apr 4, 2025
8dcfb82
Merge branch 'develop' of https://github.com/credebl/platform into fe…
bhavanakarwade Apr 4, 2025
80d3289
fix: formatting changes
bhavanakarwade Apr 4, 2025
a5783bb
fix: resolved sonar cloud issue
bhavanakarwade Apr 4, 2025
5865fcf
fix: security hotspot issue
bhavanakarwade Apr 4, 2025
80eb1a6
feat: added schema builder function
bhavanakarwade Apr 4, 2025
4526613
Merge branch 'develop' of https://github.com/credebl/platform into fe…
bhavanakarwade Apr 4, 2025
6c3a2f8
fix: resolved issue
bhavanakarwade Apr 4, 2025
65cbb82
refactor: modify extract attributes function
bhavanakarwade Apr 9, 2025
129c563
fix: destructured objects
bhavanakarwade Apr 9, 2025
64597a7
feat: added description property
bhavanakarwade Apr 9, 2025
802bb8f
fix: added validations for schema type
bhavanakarwade Apr 10, 2025
e8bc6f6
resolved conflicts
bhavanakarwade Apr 10, 2025
390e63b
formatted enum file
bhavanakarwade Apr 10, 2025
ae5269e
chore: added enum for indy schema data type
bhavanakarwade Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions apps/api-gateway/src/dtos/create-schema.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { ApiExtraModels, ApiProperty, ApiPropertyOptional, getSchemaPath } from '@nestjs/swagger';
import { plainToClass, Transform, Type } from 'class-transformer';
import { IsNotSQLInjection, trim } from '@credebl/common/cast.helper';
import { JSONSchemaType, SchemaTypeEnum, W3CSchemaDataType } from '@credebl/enum/enum';
import { IndySchemaDataType, JSONSchemaType, SchemaTypeEnum, W3CSchemaDataType } from '@credebl/enum/enum';

export class W3CAttributeValue {
@ApiProperty()
Expand All @@ -37,7 +37,9 @@ export class W3CAttributeValue {
enum: W3CSchemaDataType,
example: W3CSchemaDataType.STRING
})
@IsEnum(W3CSchemaDataType, { message: 'Schema data type must be a valid type' })
@IsEnum(W3CSchemaDataType, {
message: `Schema data type must be one of [${Object.values(W3CSchemaDataType).join(', ')}]`
})
schemaDataType: W3CSchemaDataType;

@ApiProperty()
Expand Down Expand Up @@ -205,11 +207,17 @@ class AttributeValue {
@IsNotEmpty({ message: 'attributeName is required' })
attributeName: string;

@ApiProperty()
@ApiProperty({
description: 'The type of the schema',
enum: IndySchemaDataType,
example: IndySchemaDataType.STRING
})
@IsString()
@Transform(({ value }) => trim(value))
@IsNotEmpty({ message: 'schemaDataType is required' })
schemaDataType: string;
@IsEnum(IndySchemaDataType, {
message: `Schema data type must be one of [${Object.values(IndySchemaDataType).join(', ')}]`
})
schemaDataType: IndySchemaDataType;

@ApiProperty()
@IsString()
Expand Down
Loading