Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for strfmt.DateTime to datetime mapping to support go-swagger generated models #348

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

solcates
Copy link

@solcates solcates commented Mar 17, 2017

Digging gorp, and in my pursuit of using it to connect to a legacy DB, I found that the swagger generated models, didn't match up with strfmt.DateTime (what go-swagger generates strings of time date-time)... So i added it.

In swagger yaml use this...

  legacy_user:
    type: object
    properties:
      id:
        type: integer
        format: int64
        x-go-custom-tag: db:"id"
      last_login:
        type: string
        format: date-time
        x-go-custom-tag: db:"last_login"

@solcates
Copy link
Author

Added "Date" type for mysql as well

@solcates
Copy link
Author

Added "unique" reflection support to create unique columns i.e. email etc...

@nelsam
Copy link
Member

nelsam commented Aug 30, 2017

This seems reasonable. Can you include a test that fails without these changes?

@solcates
Copy link
Author

solcates commented Sep 2, 2017

Sure will add that sometime this week

@icholy icholy mentioned this pull request Oct 18, 2017
@nelsam
Copy link
Member

nelsam commented Jul 30, 2018

@solcates have you had time to work out a test for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants