danieleteti / delphimvcframework

DMVCFramework (for short) is a popular and powerful framework for WEB API in Delphi. Supports RESTful and JSON-RPC WEB APIs development.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swagger Support ?

CastleSoft opened this issue · comments

Feature request.. Would it be possible to add Swagger support to DelphiMVC ?

http://swagger.io/

In C# and with WebAPI, I can use NSwag to generate a Swagger Specification, TypeScript Client and CSharp Client.

Embarcadero's Berlin (EMS) now supports Swagger 2.0

http://docwiki.embarcadero.com/RADStudio/Berlin/en/EMS_API_Resource

Yes, it is in the roadmap.

Thanks for danieleteti's team work.
Swagger is very useful.
Is there any progress?
Can we do something for it?

We are planning swagger support. Do you have some swagger generator which generates Delphi code for the client?
the design work is about adding all the metadata description that swagger needs. Currently we have only MVCDoc attribute as description for the actions. MVCDoc is already used in the system controller /system/describerserver.info

I do not have generates Delphi code for the client.
But I can try to do something tomorrow in my free time.

how is the status? still on the Roadmap?

Sure, it is on the roadmap. At the next iteration it will be take in consideration.

Hi, Thanks for this framework :)
Is there any progress with Swagger? I use it in Spring Boot and it is very useful.

This feature will be implemented using this library.

commented

There is an impressive swagger work implemented in AutoTablesForRADServer

it uses SwagDoc and Swagger-UI

I've been working on adding SwagDoc into the delphimvcframework. It is a work in progress at the moment... I still have to handle schema/data types and fill out a few more details.

https://github.com/geoffsmith82/delphimvcframework/tree/swaggerdoc

Good @geoffsmith82 , when you are ready we can integrate your work in the repo.

I've also been working on a program to go the other way... Swagger json file turned into a DelphiMVCFramework Controller class.

That's a good news. Keep me informed, if you need help.

I had to document my API, so I created middleware to generate Swagger documentation. Pull request #253

Just added a pull request with my initial swagger demo projects.
#254

Great news about this issue. We got 2 PRs!

  • One bases on middleware (#253)
  • One based on specific controller (#254)

While I like the idea to put the swagger controller into the already present system controllers, the middleware is abit more flexible while add a little overhead compared to the controller (middleware are always checked and called by the router, independently from the URL, while controllers are checked starting from the URL as first check).

Would be great if we could find a solution where @geoffsmith82 and @joaoduarte19 can work together without fragment the effort.

Can we find such solution?
The solution from @geoffsmith82 (based on controller) seems to have an initial support for client side code generation, which is good.

Do you guys have any though about the "merge" of the efforts?

I agree that merging the two works will be great.

I've done an initial merge of @joaoduarte19 middlewareswagger_dev branch into mine. There was no merge conflicts. I have combined both our attributes together into one file at this stage. Some are very similar and some are different. I am also wondering if some of these would be better in the Swagdoc project and just referenced in the DelphiMVCFramework.

Just thought I would give you an update. I've been working on improving the Swagdoc project.

Any news on this?

I believe that this issue can now be finalized, as currently Swagger support already works relatively well.

commented

I confirm, it works very well !