You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following worked in Foal 2.x but fails in 3.0. To get it to work in Foal 3.0, I had to remove the use of the "example" keyword from each of the schema properties.
import{Context,Post,HttpResponseOK,HttpResponseCreated,dependency,Get,Delete,HttpResponseNotFound,HttpResponseServerError,HttpResponseInternalServerError,HttpResponseUnauthorized,HttpResponseBadRequest,HttpResponseConflict,HttpResponseForbidden,ApiDefineHeader,ApiSecurityRequirement,MergeHooks}from'@foal/core';import{ValidatePathParam,ValidateQueryParam,ValidateBody,ValidateHeader}from'@foal/core';import{ApiUseTag,ApiOperationId,ApiOperationDescription,ApiOperationSummary,ApiResponse,ApiDefineSchema,IApiSchema}from'@foal/core';import{DidPosture}from'../services/organization.service';import{OrganizationService}from'../services';import{Organization}from'../entities';constorganizationCreateSchema : IApiSchema={additionalProperties: false,properties: {name: {type: 'string',example: 'My Organization Name',description: 'The name of the new organization.'},logoUrl: {type: 'string',example: 'http://issuer-website.com/issuer-image.png',description: 'The URL to an image representing the logo for this organization.'},organizationId: {type: 'string',example: '5b3d3536-f44a-4492-bb40-0a5bbf288176',description: 'The AffinitiQuest.io organization identifier.'},didPosture: {type: 'string',enum: [DidPosture.public,DidPosture.private],example: 'public',description: 'will the Did for this organization be publically published on the ledger or not.'}},required: ['name','logoUrl','organizationId','didPosture'],type: 'object',}
@ApiDefineSchema('organization-create-schema',organizationCreateSchema)
@ApiUseTag('organization - Operations related to managing organizations')exportclassOrganizationController{
@dependencyorganizationService: OrganizationService;
@Post('/')
@ApiOperationId('createOrganization')
@ApiOperationDescription('Creates a new organization/wallet, creates a Did in the wallet and optionally on the ledger (if query parameter didposture=public). ')
@ApiOperationSummary('Create an organization')
@ApiResponse(201,{description: 'Organization created.',content: {'application/json': {schema: {$ref: '#/components/schemas/organization-response-schema'}}}})
@ApiResponse(400,{description: 'Bad Request. Error while attempting to create, typically due to bad parameters'})
@ApiResponse(401,{description: 'Unauthorized. Probably due to an invalid api key'})
@ApiResponse(409,{description: 'Conflict. Duplicate name'})
@ApiResponse(500,{description: 'Internal Server Error. Probably due to Aries API being down'})
@ValidateBody({$ref: '#/components/schemas/organization-create-schema'})asynccreateOrganization(ctx: Context){constorganizationId=ctx.request.body.organizationId;constorganizationName=ctx.request.body.name;constlogoUrl=ctx.request.body.logoUrl;constdidPosture=ctx.request.body.didPosture;consthttpResponse=awaitthis.organizationService.createOrganization(organizationId,organizationName,logoUrl,didPosture);returnhttpResponse;}}
The text was updated successfully, but these errors were encountered:
Version of FoalTS: 3.0
The following worked in Foal 2.x but fails in 3.0. To get it to work in Foal 3.0, I had to remove the use of the "example" keyword from each of the schema properties.
The text was updated successfully, but these errors were encountered: