Skip to content

Conversation

pcapriotti
Copy link
Contributor

@pcapriotti pcapriotti commented Sep 22, 2021

This changes the Swagger implementation of unnamed in schema-profunctor to drop the name, but still declare the corresponding named schema. Now even unnamed schemas that are not actually referenced anywhere will appear in the list of schemas in Swagger.

Also changed the name of the schema for SimpleMember to make it reflect the Haskell type name.

shot

Thanks @atomrc for reporting this issue.

Checklist

  • The PR Title explains the impact of the change.
  • The PR description provides context as to why the change should occur and what the code contributes to that effect. This could also be a link to a JIRA ticket or a Github issue, if there is one.
  • changelog.d contains the following bits of information:
    • A file with the changelog entry in one or more suitable sub-sections. The sub-sections are marked by directories inside changelog.d.

This changes the Swagger implementation of `unnamed` in
schema-profunctor to drop the name, but still declare the corresponding
named schema. Now even unnamed schemas that are not actually referenced
anywhere will appear in the list of schemas in Swagger.

Also changed the name of the schema for `SimpleMember` to make it
reflect the Haskell type name.

Thanks @atomrc for reporting this issue.
Copy link
Member

@jschaul jschaul left a comment

Choose a reason for hiding this comment

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

Looks good. I didn't try this out, but does this change still pass the online swagger validation tool when unreferenced things are present?

@pcapriotti
Copy link
Contributor Author

It does not, but nor did before. I'll fix it in another PR, if that's ok. We should also think about incorporating this check in the tests, because it's hard to remember to do it, and many possible things affect Swagger.

@jschaul
Copy link
Member

jschaul commented Sep 22, 2021

It does not, but nor did before. I'll fix it in another PR, if that's ok. We should also think about incorporating this check in the tests, because it's hard to remember to do it, and many possible things affect Swagger.

Sure, that's fine. Yes about adding tests. Can we download a validation library and make it part of the tooling? (I wouldn't want to rely on the uptime of online testing websites in integration tests).

@pcapriotti pcapriotti merged commit 0ba7f2c into develop Sep 23, 2021
@pcapriotti pcapriotti deleted the pcapriotti/reference-event-data-schemas branch September 23, 2021 06:23
mdimjasevic pushed a commit that referenced this pull request Sep 23, 2021
This changes the Swagger implementation of `unnamed` in
schema-profunctor to drop the name, but still declare the corresponding
named schema. Now even unnamed schemas that are not actually referenced
anywhere will appear in the list of schemas in Swagger.

Also changed the name of the schema for `SimpleMember` to make it
reflect the Haskell type name.

Thanks @atomrc for reporting this issue.
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