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

feat: make generated code more idiomatic to go users #16

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

nilslice
Copy link
Member

@nilslice nilslice commented Sep 4, 2024

Convert any end-user facing identifier to a more Go-friendly option, using the latest helpers in xtp-bindgen. e.g.:

For this schema portion:

snake_case_func_name:
    description: This is a function that uses snake case in the name
    input:
      type: string
      contentType: text/plain; charset=utf-8
      description: A string passed into plugin input
    output:
      $ref: "#/components/schemas/some_value"
      contentType: application/json
#...
components:
  schemas:
    some_value:
      properties:
        a_string:
          type: string
          description: a string

We now produce:

// This is a function that uses snake case in the name
// It takes string as input (A string passed into plugin input)
// And returns SomeValue ()
func SnakeCaseFuncName(input string) (SomeValue, error) {
	// TODO: fill out your implementation here
	panic("Function not implemented.")
}

Copy link

@chrisdickinson chrisdickinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nilslice nilslice merged commit 17e5059 into main Sep 5, 2024
3 checks passed
@nilslice nilslice deleted the ident-conversion branch September 5, 2024 15:48
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.

3 participants