Recent

Author Topic: Is it practical or even possible to generate a REST API for the LCL controls?  (Read 347 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1103
    • HowTos Considered Harmful?
Is it practical or even possible to generate a REST API for the LCL controls?

Can it be generated automatically from its published properties?

I just saw this announcement New Swagger/OpenAPI Client Generator for FPC  by @abouchez.

Forgive me if my question sounds stupid, but REST APIs have never been a thing for me. I've never truly worked with them.
« Last Edit: September 16, 2024, 09:26:08 am by vfclists »
Lazarus 3.0/FPC 3.2.2

nummer8

  • Full Member
  • ***
  • Posts: 115
I don't know if I understand your question correctly but check the following package
lazarus->components->sqldbrest-> lazsqldbrest.lpk
It is a package to assist you visually in creating REST endpoints direct from data.


Thaddy

  • Hero Member
  • *****
  • Posts: 15687
  • Censorship about opinions does not belong here.
Yes, that is possible.
A good example are the Google API' s that are machine generated and fully rest.
The package also contains the code that does the actual generation.
You could adapt it to an LCL api generator since components can already be represented in JSON,
If I smell bad code it usually is bad code and that includes my own code.

 

TinyPortal © 2005-2018