hemerajs / hemera

🔬 Writing reliable & fault-tolerant microservices in Node.js https://hemerajs.github.io/hemera/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Export Joi validation to documentation?

PatrickHeneise opened this issue · comments

Is there a way to generate JSDoc from the Joi definitions? There's plugins for that for fastify/koa/hapi to generate Swagger. Would be very interesting to have that.

How would one approach this issue?

No, but a plugin is very welcome. You can archive it with the onAdd extension

hemera.ext('onAdd', addDefinition => {
  // some code
  addDefinition.pattern
  addDefinition.schema
  addDefinition.action
  addDefinition.transport
})

great, thanks! We'll look into it

@PatrickHeneise a very good starting point is https://github.com/fastify/fastify-swagger. You can expose the hemera services with https://github.com/hemerajs/hemera/tree/master/packages/hemera-web to make them accesible in the UI.

I wonder if JSDoc would make a better documentation than swagger, after all it is internal documentation. I'll look into it after we're through with the sprint, too many things on the list still, thanks a lot for the starting point!

Do you using hemera in production or as side-project?

will be in production soon ;)

Great, if you have any questions you can contact us on Gitter. Yesterday, we released the new docs https://hemerajs.github.io/hemera/ for hemera 5. Can we add you to the list https://hemerajs.github.io/hemera/users.html ?

Will do, thanks! Good to know there's new docs. You can assign me to this ticket, so I have it on my tracker.

I will close it due to inactivity. Feel free to create a PR to add your plugin to the website.

Sorry about that. It’s been a busy quarter, but it’s still on our list! PR should be there soon, we’ll let you know.

Any updates?

Unfortunately not. We had a basic version, but not good enough for a PR.