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

Remove filename from the interface #1591

Open
honzajavorek opened this issue Apr 6, 2016 · 2 comments
Open

Remove filename from the interface #1591

honzajavorek opened this issue Apr 6, 2016 · 2 comments

Comments

@honzajavorek
Copy link
Contributor

Current interface counts with filename being passed to dredd-transactions as an argument. I designed a new interface in apiaryio/dredd-transactions#3 where it isn't present as it should be deprecated:

# TO BE DEPRECATED: filename
# filename is used only for compiling to human readeable name in reporters
# and this logic will be moved to Dredd reporters

However, deprecating it isn't such a piece of cake 🍰 we thought with @netmilk, so I'll return the filename back to the interface and I'm filing this issue to have a memory that we want to remove it in the future.

@honzajavorek
Copy link
Contributor Author

I guess this is blocked until #227 gets finished.

@honzajavorek
Copy link
Contributor Author

The only (?!) reason why filename is needed:

describe('without sections', () => {
  const filename = 'apiDescription.apib';
  const { mediaType, apiElements } = fixtures('without-sections').apib;
  const compilationResult = compile(mediaType, apiElements, filename);

  it('produces one transaction', () => assert.jsonSchema(compilationResult, createCompilationResultSchema({
    transactions: 1,
  })));

  context('\'origin\'', () => {
    it('uses filename as API name', () => assert.equal(compilationResult.transactions[0].origin.apiName, filename));
    it('uses empty string as resource group name', () => assert.equal(compilationResult.transactions[0].origin.resourceGroupName, ''));
    it('uses URI as resource name', () => assert.equal(compilationResult.transactions[0].origin.resourceName, '/message'));
    it('uses method as action name', () => assert.equal(compilationResult.transactions[0].origin.actionName, 'GET'));
  });
});

@artem-zakharchenko artem-zakharchenko transferred this issue from apiaryio/dredd-transactions Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants