question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Specification Document Splitting Clarification

See original GitHub issue

Currently, the Location and formats section of the MP OpenAPI specification reads as follows:

Vendors are required to fetch a single document named openapi with an extension of yml, yaml or json, inside the application module’s root META-INF folder. If there is more than one document found that matches one of these extensions the behavior of which file is chosen is undefined (i.e. each vendor may implement their own logic), which means that application developers should only place a single openapi document into that folder.

Here, the specification states that vendors are only required to retrieve a single document, which contrasts with the OpenAPI specification, which states the following:

An OpenAPI document MAY be made up of a single document or be divided into multiple, connected parts at the discretion of the user. In the latter case, $ref fields MUST be used in the specification to reference those parts as follows from the JSON Schema definitions.

From local tests, it would seem that splitting the OpenAPI document across multiple files, as permitted by the OpenAPI specification, is not supported within MP OpenAPI implementations. If this is the case, the MP OpenAPI specification is a little vague on whether splitting is permitted, as the MP specification states that vendors are only required to fetch a single document:

Vendors are required to fetch a single document named openapi with an extension of yml, yaml or json, inside the application module’s root META-INF folder.

This stems from an issue raised against Open Liberty #https://github.com/OpenLiberty/open-liberty/issues/15428. This was further tested with Open Liberty implementation of 2.0 which consumes SmallRye, which displayed the same behaviour as described in the issue.

If splitting is not supported by MP OpenAPI, I believe we should update the specification to clarify and reflect this.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
msmithscommented, Jan 14, 2021

@MikeEdgar I am not convinced that we can claim that document splitting is supported as long as the user follows the caveats that you have outlined, i.e., the referenced files are put in an accessible location and absolute references are used. My understanding of what @igbluz is trying to achieve is that the referenced files should be packaged along with the implementation classes, i.e., resource class files and the YAML document contained in the same JAR file. This JAR is then packaged in the relevant WAR and the openapi.yaml includes references to schemas defined by the YAML document embedded in the JAR. I am not an expert on references, but I believe that the intention is that the runtime should be able to resolve the references without needing to make an HTTP request to a file that is really local.

I believe that it is worth putting more thought into this scenario in a future version of the MP OpenAPI specification and providing a clearer definition of what is and is not supported by MP OpenAPI.

0reactions
MikeEdgarcommented, Jan 14, 2021

@msmiths - I absolutely agree with you. I think this comes down to defining support for split OpenAPI files and support for generating split files. My earlier comments were intended to help get it working in the current state environment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Document Splitting - Clarification - SAP Community
Hi I am passing the following entry through F-02. Particulars Dr/Cr Amount Business Area Expenses a/c Dr 400 1000 Expenses a.
Read more >
62 Document Splitting New GL - YouTube
Key moments. View all · Document Splitting · Document Splitting · Document Splitting · Types of Document Spreading · Types of Document Spreading....
Read more >
SAP New GL Document Splitting in SAP S4HANA Finance 1809
SAP New GL Document Splitting in SAP S4HANA Finance 1809 | General Ledger Concept | New GL Concept · Key moments. View all...
Read more >
Document Splitting Configuration steps with example
For document splitting to be possible, the individual document items and the documents must be classified. Each classification corresponds to a rule in...
Read more >
SAP Library - General Ledger Accounting (FI-GL) (New)
You can use document splitting to automatically split line items for selected dimensions (such as receivable lines by profit center) or to effect...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found