How to Document Available Body Parameters in an HTTP Trigger for Future Reference and Review?

This topic was automatically generated from Slack. You can find the original thread here.

building out a http trigger. Question: how can i document what the available body parameters should be? I see I can do it in the test process, but how do I add notes or modify the code examples - or somehow define this more clearly for the future me / others who will review this in - to show the required parameters? thanks.

You would have to create a custom source, e.g.

export default {
  name: "Custom HTTP Trigger",
  description: "This is a demo http trigger",
  props: {
    http: {
      type: "$.interface.http",
      label: "your label here",
      description: "this field also accepts markdown"
    },
  },
  async run(event) {
    this.$emit(event.body, {
      summary: `HTTP Request`,
    });
  },
};

Have you published sources using the CLI?

I’m happy to help giving you a walkthrough

Hi Andrew, no I haven’t yet. So I’d have to create a custom source just to store meta description info about the source, yes? This is what folks normally do? Thanks again!

You can add a Step Note instead of just editing the description, let me know if that helps

But not for sources

These videos from Pipedream University are helpful to learn how to publish a component to your account:
Components 101
Installing the PD CLI tool

hi Andrew. Thanks. Yeah, sadly adding notes (such as to describe the body properties it accepts) is not possible for triggers.