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: add help message about AnonymousSchema generated classes #211

Merged
merged 8 commits into from Jul 18, 2022

Conversation

Tenischev
Copy link
Member

Description

Many times users faced problem with AnonymousSchema model classes. This happens because some schemas element defined as sub-object (inside allOf, items e.t.c.) and parser couldn't provide any significant name for them and so class name couldn't be defined.
This behavior is not directly problem of parser or template, but rather of user's AsyncAPI itself.
So, I decided to add info message with description how to discard AnonymousSchema classes if generation result contains them.

Related issue(s)
See also #203 #131 #78

Copy link
Member

@derberg derberg left a comment

Choose a reason for hiding this comment

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

  • using template literals would be better/easier imho to build these structured console log information.
  • would be super nice to point user in some direction that will help figure out where things happened. Maybe at least consol.log paths to files with anonymous schema name models?

hooks/98_userHelp.js Outdated Show resolved Hide resolved
@Tenischev
Copy link
Member Author

  • using template literals would be better/easier imho to build these structured console log information.
  • would be super nice to point user in some direction that will help figure out where things happened. Maybe at least consol.log paths to files with anonymous schema name models?

Paths were added.
Text was a bit improved, but i'm not catch what you mean using template literals. Could you give an example?

@derberg
Copy link
Member

derberg commented May 23, 2022

@Tenischev one example of template literal:

    console.log(`
      schemas:
        NamedObject:
          type: object
          properties:
            field:
              type: array
              items:
                type: object #Anonymous object
                properties:
                  field:
                    type: string`);

most of these console.log you could put in one literal, which would make it much easier to maintain

@Tenischev Tenischev requested a review from derberg June 7, 2022 08:29
hooks/98_userHelp.js Outdated Show resolved Hide resolved
use one string for help message

Co-authored-by: Lukasz Gornicki <lpgornicki@gmail.com>
@Tenischev Tenischev requested a review from derberg June 9, 2022 20:15
@derberg
Copy link
Member

derberg commented Jun 9, 2022

I think you need to update tests

@Tenischev
Copy link
Member Author

I think you need to update tests

seems to be a bug of build

@derberg
Copy link
Member

derberg commented Jun 13, 2022

@Tenischev just keep in mind that if it is docs it won't be released. As it is an improvement in logging, I think it can easily be a feat and minor release

@derberg derberg changed the title docs: add help message about AnonymousSchema generated classes feat: add help message about AnonymousSchema generated classes Jul 18, 2022
@derberg
Copy link
Member

derberg commented Jul 18, 2022

/rtm

@asyncapi-bot asyncapi-bot merged commit e4498b0 into asyncapi:master Jul 18, 2022
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 0.28.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants