Skip to content

Instantly share code, notes, and snippets.

@ggood
Created May 6, 2016 23:02
Show Gist options
  • Save ggood/099933cdf7aba3cab4867abd500d1b25 to your computer and use it in GitHub Desktop.
Save ggood/099933cdf7aba3cab4867abd500d1b25 to your computer and use it in GitHub Desktop.
OpenAPI spec that causes generated c# constructor to be malformed.
---
swagger: '2.0'
info:
version: 0.0.0
title: Exercise c-sharp codegen bug with readonly properties
paths:
/:
get:
responses:
200:
description: OK
definitions:
Foo:
type: object
properties:
bar:
type: string
baz:
type: string
readOnly: true
@ggood
Copy link
Author

ggood commented May 6, 2016

Generated constructor is:

public Foo(string Bar = null, )
        {
            this.Bar = Bar;

        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment