raml-dotnet-tools icon indicating copy to clipboard operation
raml-dotnet-tools copied to clipboard

JsonProperty added incorrectly

Open adsgreen opened this issue 4 years ago • 0 comments
trafficstars

I have a simple RAML file that appears correct:

%RAML 1.0
title: tester
version: "1"

types:
  BaseInfo:
    type: object
    properties:
      ID:
        type: integer
     
/Tester: 
  post:
    body:
      application/json:          
        type: object
        properties:
          A:
           type: BaseInfo        
    responses: 
        "200":

I would expect it to generate classes supporting the format:

{
  "A": {
    "ID": 0
  }
}

However the generated C# model incorrectly puts a JsonProperty attribute that breaks the specification

 public partial class  TesterPost 
    {
		[JsonProperty("BaseInfo")]
        public BaseInfo A { get; set; }
    } // end class

I can't believe something so fundamental is breaking and sure it's a problem in the markup but there doesn't seem to be anything wrong with it?

adsgreen avatar Jan 27 '21 19:01 adsgreen