Skip to content

Vital Fixes #111

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

Merged

Conversation

dfithian
Copy link
Contributor

A couple things I changed here:

  1. I added an option to output all schemas. We have types that come through in a Websocket which I added to the spec. The default behavior is to not include schemas unless they are part of an operation.
  2. Newtypes, which wrap a single ref, weren't getting type aliased correctly. I think I did that now.
components:
  schemas:
    NewtypeFoo:
      description: Wrapper for a foo.
      $ref: '#/components/schemas/InnerFoo'

@dfithian
Copy link
Contributor Author

Pinging @joel-bach, in case you haven't already seen this.

@joel-bach
Copy link
Member

Hey @dfithian

Thank you for the PR, this is a good addition 👍

For the alias change, it would be great if we could have an example in the golden tests for this so it makes it clear what the resulting change looks like (you can just add your example to specifications/z_complex_self_made_example.yml and run update_golden_and_example.sh. Make sure to reference the type as well so it is included in the generated code or activate your new flag for the golden tests).

@dfithian
Copy link
Contributor Author

Thanks @joel-bach, alright I did that, and I added the --output-all-schemas flag so that it was output from the spec. Let me know if you want me to do that differently.

@joel-bach joel-bach merged commit a43742c into Haskell-OpenAPI-Code-Generator:master May 24, 2024
9 checks passed
@joel-bach
Copy link
Member

Thank you for the adjustments, looks all good 👍

@dfithian dfithian deleted the df/vital-bugfixes branch May 24, 2024 16:34
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.

2 participants