Open Closed

Getting Swagger validation error #418


0
Repunjay created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v3.0.4
  • UI type: Angular
  • Tiered (MVC) or Identity Server Seperated (Angular): yes
  • Exception message and stack trace: We are trying to create Rest API using AWS API gateway but when trying to import swagger definition of our API, it gives the validation error as mentioned below -
* {
  "messages": [
    "attribute components.schemas.Schema name Volo.Abp.Application.Dtos.PagedResultDto`1[[SCV.Litmus.InvoiceManagement.Batches.BatchDto, SCV.Litmus.InvoiceManagement.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] doesn't adhere to regular expression ^[a-zA-Z0-9\\.\\-_]+$",
    "attribute components.schemas.Schema name Volo.Abp.Application.Dtos.PagedResultDto`1[[SCV.Litmus.InvoiceManagement.Invoices.InvoiceByStatusDto, SCV.Litmus.InvoiceManagement.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] doesn't adhere to regular expression ^[a-zA-Z0-9\\.\\-_]+$",
    "attribute components.schemas.Schema name Volo.Abp.Application.Dtos.PagedResultDto`1[[SCV.Litmus.InvoiceManagement.CreditNotes.CreditNoteByStatusDto, SCV.Litmus.InvoiceManagement.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] doesn't adhere to regular expression ^[a-zA-Z0-9\\.\\-_]+$",
    "attribute components.schemas.Schema name Volo.Abp.Application.Dtos.PagedResultDto`1[[SCV.Litmus.InvoiceManagement.Batches.GetBatchDetailDto, SCV.Litmus.InvoiceManagement.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] doesn't adhere to regular expression ^[a-zA-Z0-9\\.\\-_]+$",
    "attribute components.schemas.Schema name Volo.Abp.Application.Dtos.PagedResultDto`1[[SCV.Litmus.InvoiceManagement.Invoices.InvoiceDto, SCV.Litmus.InvoiceManagement.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] doesn't adhere to regular expression ^[a-zA-Z0-9\\.\\-_]+$",
    "attribute components.schemas.Schema name Volo.Abp.Application.Dtos.PagedResultDto`1[[SCV.Litmus.InvoiceManagement.Quotes.QuoteDto, SCV.Litmus.InvoiceManagement.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] doesn't adhere to regular expression ^[a-zA-Z0-9\\.\\-_]+$",
    "attribute components.schemas.Schema name Volo.Abp.Application.Dtos.PagedResultDto`1[[SCV.Litmus.InvoiceManagement.Samples.SampleDto, SCV.Litmus.InvoiceManagement.Application.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] doesn't adhere to regular expression ^[a-zA-Z0-9\\.\\-_]+$"
  ]
}

Steps to reproduce the issue: Attached is the class file for one object "BatchDto.cs". Kindly suggest what's wrong with the class implementation and steps to resolve.

using System;
using Volo.Abp.Application.Dtos;

namespace SCV.Litmus.InvoiceManagement.Batches
{
    public class BatchDto : FullAuditedEntityDto<Guid>
    {
        public string BatchNumber { get; set; }

        public Guid SupplierId { get; set; }

        public Guid BusinessEntityId { get; set; }

        public int CurrencyId { get; set; }

        public string Description { get; set; }

        public double RequestedFinanceAmount { get; set; }

        public string BenchMark { get; set; }

        public double MarginRate { get; set; }

        public double InvoiceTotalAmount { get; set; }

        public double CreditNoteTotalAmount { get; set; }

        public double NetFinanceAmount { get; set; }

        public DateTime BatchCreationDate { get; set; }
    }
}

1 Answer(s)
  • 0
    maliming created
    Support Team

    hi

    We are trying to create Rest API using AWS API gatewaybut when trying to import swagger definition of our API, it gives the validation error as mentioned below -

    It may be that the content of swagger does not meet the requirements of AWS API gateway. Does it provide a sample of swagger?