Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

[WIP] Named endpoints #332

Merged
merged 1 commit into from
Jun 5, 2015
Merged

[WIP] Named endpoints #332

merged 1 commit into from
Jun 5, 2015

Conversation

LinusU
Copy link
Contributor

@LinusU LinusU commented May 26, 2015

Per discussion in apiaryio/api-blueprint#196.

For some reason it keeps parsing the section as copy instead of resource. No idea why thought, would appreciate some fresh 👀 on it.

@zdne
Copy link
Contributor

zdne commented May 27, 2015

@LinusU Hey, thanks for the submission!

I think you want to check the sectionType() method here https://github.com/LinusU/snowcrash/blob/named-endpoints/src/ResourceParser.h#L196 – it is basically used to figure out whether a markdown node is recognized as a resource section (= you want to match the REGEX there)

@LinusU
Copy link
Contributor Author

LinusU commented May 27, 2015

Ahhh, one line! 😆

@@ -207,6 +204,7 @@ namespace snowcrash {
                 TrimString(subject);

                 if (RegexMatch(subject, NamedResourceHeaderRegex) ||
+                    RegexMatch(subject, NamedEndpointHeaderRegex) ||
                     RegexMatch(subject, ResourceHeaderRegex)) {
                     return ResourceSectionType;
                 }

Thanks for the help! 🍻

I'm pushing a rebased version now

@LinusU LinusU force-pushed the named-endpoints branch from 9e136f6 to cd3102f Compare May 27, 2015 12:21
@zdne
Copy link
Contributor

zdne commented May 27, 2015

@LinusU

also can you please add tests for edge cases like :

# Endpoint 1  [GET /e1]
# Endpoint 2  [GET /e1]
# Endpoint 3  [POST /e1]

?

Maybe followed by

something like

# Endpoint 1  [GET /e1]
# E 1 resource [/e1]
## Retrieve [GET]
## Do Something Else [POST /e1]

etc.

@LinusU
Copy link
Contributor Author

LinusU commented May 27, 2015

Sure, I'll add them now!

@LinusU LinusU force-pushed the named-endpoints branch from cd3102f to 5300879 Compare May 27, 2015 12:38
@LinusU
Copy link
Contributor Author

LinusU commented May 27, 2015

Done and done, was that how you meant?

@LinusU
Copy link
Contributor Author

LinusU commented May 27, 2015

Ahh, I read your comment in the other thread now. Do you want it to merge it all into one resource with three actions?

@@ -156,6 +156,7 @@
'test/test-MSONTypeSectionParser.cc',
'test/test-MSONUtility.cc',
'test/test-MSONValueMemberParser.cc',
'test/test-NamedEndpoint.cc',
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think these test cases should be in a separate file. Please add them in test-ActionParser.cc.

@LinusU LinusU force-pushed the named-endpoints branch from 5300879 to 967a672 Compare June 5, 2015 07:49
@LinusU
Copy link
Contributor Author

LinusU commented Jun 5, 2015

Should be good to go 👍

pksunkara added a commit that referenced this pull request Jun 5, 2015
@pksunkara pksunkara merged commit 237091c into apiaryio:master Jun 5, 2015
@LinusU
Copy link
Contributor Author

LinusU commented Jun 5, 2015

Thanks for the merge 🎉 ✌️

@LinusU LinusU deleted the named-endpoints branch June 5, 2015 09:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants