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

Swagger Documentation Controller #254

Merged
merged 47 commits into from
Sep 25, 2019
Merged

Conversation

geoffsmith82
Copy link
Contributor

Here is my Swagger Documentation Generator Controller and Controller Generator from a Swagger file.

  • Uses the SwagDoc project - although I have made some changes to it - still need to push them up to that project
  • Still a work in progress
  • Can Generate Swagger documentation including data structures.
  • Decoding of Swagger documentation to generate Controller is very basic at this stage - probably will have trouble with many swagger files unless they are created in the expected way.

@geoffsmith82 geoffsmith82 mentioned this pull request Jul 29, 2019
@danieleteti
Copy link
Owner

Hi, thanks for your great work.
However, the code doesn't seems compilable. Am I missing something?

[dcc32 Error] MVCFramework.Controllers.Swagger.pas(128): E2003 Undeclared identifier: 'ohvTRACE'

[dcc32 Error] MVCFramework.Controllers.Swagger.pas(221): E2003 Undeclared identifier: 'MVCResponseAttribute'

@geoffsmith82
Copy link
Contributor Author

I added ohvTRACE to to the TSwagPathTypeOperation enumeration in Swag.Common.Types.

TSwagPathTypeOperation = (ohvNotDefined, ohvGet, ohvPost, ohvPut, ohvDelete, ohvOptions, ohvHead, ohvPatch, ohvTrace);

I have some commits on the SwagDoc project as well that will combine with this to make it all work.

Not sure why you are getting the error about MVCResponseAttribute, as it is in this branch.

@geoffsmith82
Copy link
Contributor Author

It is still a bit of a work in progress... I'm working on Client API from Swagger file, MVC Controller from Swagger file and Swagger file from MVC Controller. My goals are to

  • enable delphi types to be used in as many places as possible and avoid people having to use JSON.
  • Attributes that enable specifying swagger properties
  • Attributes that also enable requests and responses to be validated on the server side and the client side before the data is handed over to be processed.

I will probably develop the client API in the SwagDoc repository

@danieleteti
Copy link
Owner

I saw that both @joaoduarte19 and @geoffsmith82 are working on this branch. Should the other related to the swagger support be closed? Also, is the work done for the next RC? Do you have some other features/fix to do for this PR? Thank you for your support

@danieleteti
Copy link
Owner

danieleteti commented Sep 25, 2019

I saw that both @joaoduarte19 and @geoffsmith82 are working on this branch. Should the other related to the swagger support be closed? Also, is the work done for the next RC? Do you have some other features/fix to do for this PR? Thank you for your support

To @joaoduarte19 and @geoffsmith82

Any news about this? I'd like to officialy add swagger support, but, please help me to understand how the things are going on. Can I merge this PR or the other one? What's is more feature complete?

@danieleteti danieleteti merged commit 7955c40 into danieleteti:master Sep 25, 2019
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.

None yet

3 participants