Giter VIP home page Giter VIP logo

Comments (7)

sanjiva avatar sanjiva commented on May 14, 2024

A file can contain one or more resources. If a file contains resources then that file can be a service - with appropriate annotations as needed.

If a file has other things (like actors and functions) then those play no part of the service aspect.

from ballerina-lang.

sanjiva avatar sanjiva commented on May 14, 2024

Each file with one or more resources becomes a service.

from ballerina-lang.

isudana avatar isudana commented on May 14, 2024

Service name is not going to be the name of the file rather context defined as an annotation.

from ballerina-lang.

kasun04 avatar kasun04 commented on May 14, 2024

We might have to support service name annotation as this is useful in representing a given service (title) via OpenAPI spec.

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#infoObject

from ballerina-lang.

chanakaudaya avatar chanakaudaya commented on May 14, 2024

We define the service at the beginning of the file as in the below example.

package samples.echo;

service EchoService;

@GET
@Path ("/*")
resource echoResource (message m) {
    reply m;
}

from ballerina-lang.

FrankLeymann avatar FrankLeymann commented on May 14, 2024

Is the following correct:
A single file can contain resources with very different annotations. E.g. some resources have annotations that refer to HTTP parameters; some other resources have JMS annotations; etc.

I looks very strange to me to call that a single service: a single service that reacts to a bunch HTTP request, to JMS publish, etc.

Wrt Kasun's comment: In Swagger, the title field refers to the title of the application. And for me, an application may support more than one service.

Summary: we should not only decouple file name and service name, but also support multiple services within a single Balerina file.

from ballerina-lang.

sanjiva avatar sanjiva commented on May 14, 2024

Hi Frank - latest syntax does exactly what you said .. file name is irrelevant and a file can contain multiple services.

Closing the issue.

from ballerina-lang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.