mardi 23 juin 2020

Openapi-generator: could not process "ModelName". Please make sure schema is correct

I use Swashbuckle.AspNetCore (5.2) for generate swagger.json. I have two classes

public class MyModel
{
    public string Comment {get;set;}
}

public class MyDetailedModel : MyModel
{
    public string Details {get;set}
}

I have set in my generating option

GeneratePolymorphicSchemas()

While generating TypeScript client by openapi-generator I get error "could not process "MyModel". Please make sure schema is correct". It looks in swagger.json like below

"MyModel" {
   "required": [
       "$type"
   ],
   "type": "object",
   "properties: {...},
   "discriminator" : {
      "propertyName": "$type"
   }
}

Question: how to remove such error and generate client?




Aucun commentaire:

Enregistrer un commentaire