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

Requirement component part class not working correctly #243

Closed
manuelfuenmayor opened this issue Aug 18, 2021 · 5 comments
Closed

Requirement component part class not working correctly #243

manuelfuenmayor opened this issue Aug 18, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@manuelfuenmayor
Copy link

In relation to #242 and metanorma/ogcapi-processes#1

Requirement Component block is being ignored.

Markup sample:

[[per_core_limit-default-minimum-maximum]]
[.permission,label="/per/core/limit-default-minimum-maximum"]
====
[.component,class=part]
---
The values for `minimum`, `maximum` and `default` in requirement `/req/core/limit-definition` are only examples and MAY be changed.
---
====

Output:
cap2

@manuelfuenmayor manuelfuenmayor added the bug Something isn't working label Aug 18, 2021
@manuelfuenmayor manuelfuenmayor changed the title Requirement component part class not working Requirement component part class not working correctly Aug 18, 2021
@manuelfuenmayor
Copy link
Author

In addition, in regard to Conformance Classes, there are cases where the order of the field is not what expected.

For example:

[[ats_html]]
[requirement,type="conformanceclass",label="http://www.opengis.net/spec/ogcapi-processes-1/1.0/conf/dismiss",
subject='<<rc_core,Requirements Class "Core">>',
inherit='<<ats_core,Conformance Class "Core">>',classification="Target Type:Web API"]
====
====

renders:
cap3

Note that Target Type field resulted in the last row.
This is a little different to original source:

[[ats_html]]
[cols="1,4",width="90%"]
|===
2+|*Conformance Class*
2+|http://www.opengis.net/spec/ogcapi-processes-1/1.0/conf/html
|Target type |Web API
|Requirements class |<<rc_html,Requirements Class "HTML">>
|Dependency |<<ats_core,Conformance Class 'Core'>>
|===

Not sure if it's relevant though.

@manuelfuenmayor
Copy link
Author

Another issue occurs when single quotes are used inside inherit field:

[[ats_oas30]]
[requirement,type="conformanceclass",
label="http://www.opengis.net/spec/ogcapi-processes-1/1.0/conf/oas30",
subject='<<rc_oas30,Requirements Class "OpenAPI Specification 3.0">>',
inherit="<<ats_core,Conformance Class 'Core'>>",
classification="Target Type:Web API"]
====
====

I get a malformed string:
cap4

If I change the inherit to: inherit='<<ats_core,Conformance Class "Core">>'
the problem gets solved.

@opoudjis
Copy link
Contributor

opoudjis commented Aug 18, 2021

[[per_core_limit-default-minimum-maximum]]
[.permission,label="/per/core/limit-default-minimum-maximum"]
====
[.component,class=part]
---
The values for `minimum`, `maximum` and `default` in requirement `/req/core/limit-definition` are only examples and MAY be changed.
---
====

Error in my sample markup: An open block must be notated with --, not ---. --- is only used if embedded inside a ---delimited block. Replace all instances of --- with --.

opoudjis added a commit to metanorma/metanorma.org that referenced this issue Aug 18, 2021
@opoudjis
Copy link
Contributor

opoudjis commented Aug 18, 2021

In addition, in regard to Conformance Classes, there are cases where the order of the field is not what expected.

For example:

[[ats_html]]
[requirement,type="conformanceclass",label="http://www.opengis.net/spec/ogcapi-processes-1/1.0/conf/dismiss",
subject='<<rc_core,Requirements Class "Core">>',
inherit='<<ats_core,Conformance Class "Core">>',classification="Target Type:Web API"]
====
====

renders:
cap3

Note that Target Type field resulted in the last row.
This is a little different to original source:

[[ats_html]]
[cols="1,4",width="90%"]
|===
2+|*Conformance Class*
2+|http://www.opengis.net/spec/ogcapi-processes-1/1.0/conf/html
|Target type |Web API
|Requirements class |<<rc_html,Requirements Class "HTML">>
|Dependency |<<ats_core,Conformance Class 'Core'>>
|===

Not sure if it's relevant though.

The metadata fields are being extracted in a fixed order, since I'm building the table out of source XML. I think we can treat that as a feature, not a bug:

  • Obligation
  • Subject (inc. Requirements class)
  • Dependency
  • Components other than Part
  • Part Components
  • Classifications
  • Everything else (including nested requirements)

It would be hard, though not impossible, to respect the order in which attributes are entered in the source, but I do think we should impose consistency going forward.

@opoudjis
Copy link
Contributor

Another issue occurs when single quotes are used inside inherit field:

[[ats_oas30]]
[requirement,type="conformanceclass",
label="http://www.opengis.net/spec/ogcapi-processes-1/1.0/conf/oas30",
subject='<<rc_oas30,Requirements Class "OpenAPI Specification 3.0">>',
inherit="<<ats_core,Conformance Class 'Core'>>",
classification="Target Type:Web API"]
====
====

I get a malformed string:
cap4

If I change the inherit to: inherit='<<ats_core,Conformance Class "Core">>'
the problem gets solved.

Quotes are going to cause mischief within attributes at the best of times. I suggest you start using the metadata definition list workaround, it will be much more readable and less fragile:

[[ats_oas30]]
[requirement,type="conformanceclass",
label="http://www.opengis.net/spec/ogcapi-processes-1/1.0/conf/oas30",
subject='<<rc_oas30,Requirements Class "OpenAPI Specification 3.0">>',
inherit="<<ats_core,Conformance Class 'Core'>>",
classification="Target Type:Web API"]
====
====

I'd forgotten to check this functionality in with release; doing hotfix now.

opoudjis added a commit to metanorma/metanorma.org that referenced this issue Aug 19, 2021
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Aug 20, 2021
ronaldtse pushed a commit to metanorma/metanorma.org that referenced this issue Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants