cancel
Showing results for 
Search instead for 
Did you mean: 

Creating schema that contains auto incremented value from database

SOLVED
New Contributor

Creating schema that contains auto incremented value from database

So I have a table in my sql database that has an auto incremented id field. This field is auto incremented on the database side. My generated python function to add a row to this table has a variable that asks for the field that can't take a None value. I want my auto generated add row function to not ask for or have that variable at all, but I want my get row function to show the variable. This generates the field thisId in my add row function which isn't good. What is the proper way to do this?

This is what I have now for the specific property:

 

properties:
        thisId:
          type: integer
          description: blah blah blah
          readOnly: true
          nullable: true
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Staff

Re: Creating schema that contains auto incremented value from database

as your nick says, this is a confuse dev Smiley Very Happy

 

honestly i'm not sure if i follow, but swagger-codegen is not generating code for any persistant logic currently. If that's what you're trying to get, you would need to create your own generator with templates https://github.com/swagger-api/swagger-codegen#customizing-the-generator

View solution in original post

1 REPLY 1
Highlighted
Staff

Re: Creating schema that contains auto incremented value from database

as your nick says, this is a confuse dev Smiley Very Happy

 

honestly i'm not sure if i follow, but swagger-codegen is not generating code for any persistant logic currently. If that's what you're trying to get, you would need to create your own generator with templates https://github.com/swagger-api/swagger-codegen#customizing-the-generator

View solution in original post